Commit Graph

109 Commits

Author SHA1 Message Date
Martchus a3192a1113 Fix parsing top-level argument after abbreviation 2017-11-29 22:52:50 +01:00
Martchus ad705239b2 Simplify argument parsing 2017-11-29 22:07:45 +01:00
Martchus a16b056dc3 Fix reading value after abbreviation and equation sign 2017-11-29 20:23:15 +01:00
Martchus 8aff877874 Fix comparing sibling name with denoted name 2017-11-27 10:30:14 +01:00
Martchus 424a0bfb6f Add method for parsing args with customizable behavior 2017-11-27 10:25:41 +01:00
Martchus f9e4c74aff argument parser: Expose occurrence info directly
Primarily for testing porposes, see documentation.
2017-11-06 19:50:46 +01:00
Martchus cc09fdc35f Use Argument::varValueCount everywhere 2017-11-06 19:49:39 +01:00
Martchus 6bc97e5b16 Fix API doc (\macro -> \def) 2017-11-06 19:47:17 +01:00
Martchus 3c16d2beb8 Export determineTerminalSize() correctly 2017-10-30 22:34:10 +01:00
Martchus 60e4fead05 Deprecate FakeQtConfigArguments 2017-10-25 19:32:45 +02:00
Martchus ba620c5e0a Apply clang-format 2017-10-19 01:07:38 +02:00
Martchus 46f652ad00 Improve readability of ArgumentReader::read and use Phrases 2017-10-19 00:51:47 +02:00
Steven Penny e07782ae16 commandlineutils.cpp: correct rows and columns
From here:

http://docs.microsoft.com/windows/console/coord-str

- X is columns
- Y is rows

currently that is reversed with the codebase
2017-10-16 18:04:35 -05:00
Martchus 9829dbe727 Make use of escape codes configurable 2017-10-17 00:00:46 +02:00
Martchus 6933b7b33e argument parser: Add public accessor for callback 2017-10-16 23:46:21 +02:00
Martchus cf09db8166 Export ostream &operator<<(std::ostream&,const Failure&failure) 2017-10-07 23:02:29 +02:00
Martchus ee66c56905 Improve documentation 2017-09-30 18:42:34 +02:00
Martchus 46bfbdd829 Allow initialization of values for shell completion in callback
Use case is implementing completion for syncthingctl also for
device and folder IDs.
2017-09-30 18:42:21 +02:00
Martchus b7b218c831 Wrap strings which are likely long when printing help
to preserve indentation
2017-09-29 21:00:49 +02:00
Martchus 6e80640db5 Add method to determine terminal size 2017-09-29 20:56:50 +02:00
Martchus 027e784f1c Only make extra newline before example for top-level args 2017-09-29 20:56:13 +02:00
Martchus 8750e385f1 Improve doc for ArgumentParser::parseArgs()/readArgs() 2017-09-29 17:15:39 +02:00
Martchus 2f5f197b95 Add ArgumentParser::parseArgsOrExit()
to reduce boilerplate code for error handling when
parsing CLI arguments.
2017-09-29 17:14:57 +02:00
Martchus 1c450d43a2 Add method to find specified operation 2017-09-26 16:46:17 +02:00
Martchus a1d6c3ba7b Make invokeCallbacks() static as no members used 2017-09-26 16:44:22 +02:00
Martchus 37a84d64f1 Fix warnings about use of NULL in startConsole()
Can't fix warnings about old-style casts because those
macros are defined in windows headers.
2017-09-24 19:57:13 +02:00
Martchus e52fd5a4af Apply tidy after updating to clang-format 5.0.0
The behavior of clang-format slightly changed in Clang 5.0.0:
http://releases.llvm.org/5.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
2017-09-17 21:45:23 +02:00
Martchus 12be122d66 Improve printing argument info 2017-09-17 21:37:24 +02:00
Martchus d7cf4312bf bash completion: Fix case when no current word index specified 2017-07-28 18:24:52 +02:00
Martchus 1af88c964e bash completion: Show values for implicit args
So eg. `tageditor get [tab][tab]` also suggests specifying
field names directly instead of only via --fields.
2017-07-28 17:32:16 +02:00
Martchus 4157f8849a Improve argument parser tests 2017-06-25 16:03:40 +02:00
Martchus 67708663c8 Make ArgumentReader a class to prevent warning 2017-06-10 21:52:08 +02:00
Martchus 3bc1756425 Add Argument::varValueCount 2017-05-19 00:12:07 +02:00
Martchus db46948f2f Apply clang-format 2017-05-04 22:44:15 +02:00
Martchus 59e20b1043 Apply clang-format 2017-05-01 03:13:11 +02:00
Martchus 91e5a8b0b0 Show version of used libraries in --help
* Include only own libraries and Qt 5 modules
  so far
* First step to implement
  https://github.com/Martchus/tageditor/issues/13
2017-04-15 01:10:38 +02:00
Martchus 7c189b18e1 Allow nested operation arguments
eg. syncthingctl pwd rescan
2017-04-06 00:04:30 +02:00
Martchus 864605f5c8 Only assert unique names within same level
It might make sense to 'hide' arguments from
higher level if those wouldn't be combinable
anyways.
2017-04-06 00:01:56 +02:00
Martchus c30011fe09 Fix missleading error message
Unknown arg is treated is causing fatal
error in this case and hence not ignored.
2017-04-05 23:45:56 +02:00
Martchus 71231c29da Fix behavior on empty completion request 2017-04-05 22:56:01 +02:00
Martchus 89e79275e0 Ensure the console prompt is shown when app terminates 2017-03-22 02:35:28 +01:00
Martchus 5dac8fc76b Improve startConsole()
* Also try to allocate new console
* Don't set buffer info (seems to have not
  effect anyways)
2017-03-22 02:09:27 +01:00
Martchus 9a395a45d3 Fix convertArgsToUtf8() 2017-03-22 00:59:34 +01:00
Martchus 0327049b99 Don't compare signed and unsigned 2017-03-20 23:00:23 +01:00
Martchus f626bdf9c7 Fix typos 2017-03-01 18:18:54 +01:00
Martchus c4d73b0d7d Use C++14 string literal 2017-02-06 18:32:27 +01:00
Martchus 06af1c4a73 Use std::make_unique provided by C++14 2017-02-05 21:00:52 +01:00
Martchus 1ace53533a string builder: Remove unused code 2017-01-30 00:40:31 +01:00
Martchus 33d368397f Make use of newly introduced string builder 2017-01-27 18:51:54 +01:00
Martchus 1bff266fa9 Add missing #endif in platform detection 2017-01-14 02:24:36 +01:00