Maxime Coste
44a5082aaf
Commands: Refactor generate_switches_doc
2018-02-28 15:32:11 +11:00
Maxime Coste
edee85a847
Merge remote-tracking branch 'aver-d/option_display'
2018-02-28 15:09:26 +11:00
Maxime Coste
b4dc16010d
Fix out of bound read in ParameterParser::get_switch
...
The empty string case was not correctly handled.
Fixes #1883
2018-02-26 15:20:19 +11:00
aver-d
f43635c4df
Ease reading of command-line options
...
This change displays command-line options in grid format. Each
parameter is indented with two spaces and then padded to maintain
vertical alignment of each description.
I think the visual spacing makes the options much easier to
read. This is particularly important for people new to Kakoune who
use `-help` as a way to become familiar with the program.
2018-02-25 01:46:50 +00:00
Maxime Coste
5eb63a32e5
Do not reject switch parameters starting with -
...
Closes #1193
2017-07-23 23:21:51 +02:00
Maxime Coste
261e0fabcc
Improve readability of command docstrings by changing formatting
...
Fixes #1378
2017-06-04 08:37:51 +01:00
Maxime Coste
7d9f1df73a
Small code tweaks regarding flags handling
2017-03-15 18:25:59 +00:00
Maxime Coste
0a1cb4b9b1
Detect when switches are specified more than once
...
Fixes #1219
2017-02-15 18:55:11 +00:00
Maxime Coste
4f98677642
Use 'not empty' in place of 'length > 0'
2016-12-27 22:01:11 +00:00
Leira Hua
f79018cffd
Added string length check when checking switch params
...
Fixes #1051
2016-12-24 17:42:31 -08:00
Maxime Coste
da0fe5d0bd
Small code tweak in generate_switches_doc
2016-09-05 23:34:03 +01:00
Maxime Coste
693d9a4861
Store key hash in IdMap
2015-09-16 20:02:12 +01:00
Maxime Coste
b5854ece43
Change ParameterParser switch interface, use an Optional<StringView>
...
Merge has_option and option_value into a single method get_switch.
2015-03-14 19:16:46 +00:00
Maxime Coste
c57e76ee41
Cleanup parameter parser code
2015-03-12 13:58:31 +00:00
Maxime Coste
3c1a325b6f
Refactor String, use a common StringOps interface, hide std::string
2015-03-10 19:50:22 +00:00
Maxime Coste
c90bdb9862
Fix handling of -- in parameter parser
2014-08-26 22:10:54 +01:00
Maxime Coste
ba6f3b833b
fix segfault in parameter parser
2014-03-25 08:21:16 +00:00
Maxime Coste
dc953197c3
Fix support for switches style option in user commands
2014-03-20 19:50:42 +00:00
Maxime Coste
486d1269e0
Consistently name -foo things 'switches'
2014-03-02 01:08:11 +00:00
Maxime Coste
9451782648
Add command switches information, and automatically display it
2014-03-02 01:08:11 +00:00
Maxime Coste
7f9f887b4a
All commands now take directly a parameter parser
...
The command parameters description are now stored in a ParameterDesc
structure.
2014-03-02 01:08:11 +00:00
Maxime Coste
5adee4a6a7
rename assert to kak_assert to avoid collisions
2013-04-09 20:04:11 +02:00
Maxime Coste
76e73866e5
ParameterParser takes flags
...
Only implemented flag is OptionsOnlyAtStart which considers
options given after the first positional parameter as a positional one
2013-04-02 14:22:55 +02:00
Maxime Coste
29f79346c3
Move parameter count validation to the ParameterParser
2013-03-27 14:27:12 +01:00
Maxime Coste
43bc8314fb
ParameterParser: refactoring, simplify
2013-02-27 20:51:44 +01:00
Maxime Coste
cd8c36fc50
Add a debug option to Makefile, and use KAK_DEBUG define to remove debug code
2013-02-27 19:02:01 +01:00
Maxime Coste
158f5a5c84
extract ParametersParser to it's own file
2012-12-07 19:20:26 +01:00