mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-27 02:04:39 +00:00
fix docs
This commit is contained in:
parent
864fe83d42
commit
cc87accb8b
16
README.md
16
README.md
@ -3,11 +3,8 @@ Global functions used in applications QuasarApp.
|
||||
This lib include include next modules:
|
||||
|
||||
* Locales - This module use for parse local files. This module allows you to work with translations.
|
||||
|
||||
* Params - This module use for parese app params and create log.
|
||||
|
||||
* Settings - This is a module that allows you to work with application settings.
|
||||
|
||||
* Global - This module contains other global functions.
|
||||
|
||||
|
||||
@ -49,24 +46,13 @@ target_link_libraries(MyBinary PUBLIC QuasarApp)
|
||||
```
|
||||
|
||||
# Usage
|
||||
Create objects of the BigInt class, and do what you got to do!
|
||||
|
||||
```cpp
|
||||
#include <quasarapp.h>
|
||||
|
||||
if (!QuasarAppUtils::Params::parseParams(argc, argv)) {
|
||||
QuasarAppUtils::Params::log("Warning message", QuasarAppUtils::Warning);
|
||||
|
||||
Help::Charters help = {
|
||||
{
|
||||
"Main Section ", {
|
||||
{"-argument1", "description of the argument1"},
|
||||
{"-argument2", "description of the argument2"},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
QuasarAppUtils::Help::print(help);
|
||||
QuasarAppUtils::Params::showHelp();
|
||||
exit(0);
|
||||
}
|
||||
```
|
||||
|
10
params.cpp
10
params.cpp
@ -74,11 +74,13 @@ bool Params::isDebugBuild() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void Params::showHelp(const QString &option) {
|
||||
if (userHelp.contains(option))
|
||||
Help::print(userHelp.value(option));
|
||||
else
|
||||
void Params::showHelp() {
|
||||
|
||||
if (inputOptions.size() > 1) {
|
||||
showHelpForInputOptions();
|
||||
} else {
|
||||
Help::print(userHelp);
|
||||
}
|
||||
}
|
||||
|
||||
void Params::showHelpForInputOptions() {
|
||||
|
15
params.h
15
params.h
@ -43,6 +43,18 @@ enum VerboseLvl {
|
||||
* This Class support next comandline arguments.
|
||||
* * **-verbose** (level 1 - 3) Shows debug log
|
||||
* * **-fileLog** (path to file) Sets path of log file. Default it is path to executable file with suffix '.log'
|
||||
*
|
||||
* ### Usage
|
||||
*
|
||||
* ```cpp
|
||||
#include <quasarapp.h>
|
||||
|
||||
if (!QuasarAppUtils::Params::parseParams(argc, argv)) {
|
||||
QuasarAppUtils::Params::log("Warning message", QuasarAppUtils::Warning);
|
||||
QuasarAppUtils::Params::showHelp();
|
||||
exit(0);
|
||||
}
|
||||
```
|
||||
*/
|
||||
class QUASARAPPSHARED_EXPORT Params
|
||||
{
|
||||
@ -144,9 +156,8 @@ public:
|
||||
|
||||
/**
|
||||
* @brief showHelp This method shows all help message.
|
||||
* @param option This is option key that needed show a help message.
|
||||
*/
|
||||
static void showHelp(const QString& option = "");
|
||||
static void showHelp();
|
||||
|
||||
/**
|
||||
* @brief showHelpForInputOptions This method show help for each input option.
|
||||
|
Loading…
x
Reference in New Issue
Block a user