Commit Graph

100 Commits

Author SHA1 Message Date
Martchus 4e2539548d Remove FALLTHROUGH macro
Since this is requiring C++17 anyways there's no need for
it anymore.
2019-06-12 20:33:43 +02:00
Martchus b48b2f5c06 Have everything in one top-level namespace 2019-06-10 21:56:46 +02:00
Martchus 4c1b733290 Rework ArgumentParser::parseArgs()
* Remove "ext()" and "orExit()" versions
* Exit by default (might be intrusive but it is the most
  common use)
* Rename Failure to ParseError
2019-06-10 16:03:27 +02:00
Martchus 1ad90eb770 Use std::filesystem in argumentparser.cpp 2019-06-05 23:49:35 +02:00
Martchus b0b92ff1bf Allow marking argument as deprecated 2019-05-04 23:14:43 +02:00
Martchus 6d4e13f2dc Use struct to store global application info 2019-05-04 22:49:57 +02:00
Martchus 80fba8b6d4 Reduce indentation in argumentparser.cpp 2019-05-04 22:35:00 +02:00
Martchus 04a8ef02d5 Remove deprecated dependencyVersions 2019-05-04 21:44:25 +02:00
Martchus 497826f634 Prevent warnings in argumentparser{,tests}.cpp 2019-05-04 21:44:25 +02:00
Martchus 151a3ae9e5 Apply clang-format 2019-05-04 20:58:23 +02:00
Martchus cfdfc302db Use exit function passed to argument parser 2019-04-13 20:33:39 +02:00
Martchus 57c896b547 Store boolean properties of Argument as flags 2019-04-13 20:33:39 +02:00
Martchus bc8ea407bc Prevent use of static variables in ArgumentParser
Have --no-color and --help added by default rather
so argument parser is in control over them and don't
has to use static functions.
2019-04-13 20:33:39 +02:00
Martchus 3d3378c878 Improve experimental value conversion for arg parser
* Fix issues and handle conversion errors
* Add tests
2018-09-22 17:04:23 +02:00
Martchus 89a4c2f33a Skip suggestions for pre-defined values if none assigned 2018-05-11 18:13:14 +02:00
Martchus b69b841fa3 Prevent huge memory allocation for Damerau-Levenshtein algo 2018-05-11 16:15:16 +02:00
Martchus 5e8d8cb7d1 Show dashes in suggestions 2018-05-11 16:15:02 +02:00
Martchus 24720bbbc1 Fix passing cursor position to findSuggestions() 2018-05-11 15:51:30 +02:00
Martchus 5eb3e2aa75 Fix suggestion if only one available 2018-05-11 15:29:10 +02:00
Martchus f0b777207e Fix dependency version under GCC 8 2018-05-08 00:35:41 +02:00
Martchus 8ef92cbf47 Use Levenshtein algo to provide suggestions if arg not found 2018-05-07 21:59:23 +02:00
Martchus 44f0206a13 Refactor ArgumentReader::read()
* Use return-code for error handling
* Improve documentation/comments
* Improve const correctness
2018-05-07 20:04:30 +02:00
Martchus 0e8dcbecae Refactor value completion in ArgumentParser::printBashCompletion() 2018-05-06 00:36:37 +02:00
Martchus 872ee49979 Refactor ArgumentParser::printBashCompletion() 2018-05-06 00:26:42 +02:00
Martchus 55649d750a Fix calling verifyArgs() 2018-03-11 14:31:10 +01:00
Martchus 6249db3b09 Remove unused parameter in ArgumentParser::verifyArgs() 2018-03-07 20:04:37 +01:00
Martchus 368fc46e47 Improve tests of argument parser 2018-01-29 16:23:10 +01:00
Martchus 8c42a4644b Simplify ArgumentParser::readArgs() 2018-01-29 16:21:19 +01:00
Martchus ff5eb6c7c9 Do not show help for --help 2018-01-28 00:43:03 +01:00
Martchus 09f9181281 Split operations from other top-level args in --help 2018-01-28 00:38:05 +01:00
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 cc09fdc35f Use Argument::varValueCount everywhere 2017-11-06 19:49:39 +01: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
Martchus 9829dbe727 Make use of escape codes configurable 2017-10-17 00:00:46 +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 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 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 59e20b1043 Apply clang-format 2017-05-01 03:13:11 +02:00