Ticket #3805: fix --help option to show correct syntax for editor, viewer and mcdiff
commitf0d3241ecba2a749021f36ed60d5a386823c0dd9
authorDenys Vlasenko <dvlasenk@redhat.com>
Thu, 13 Apr 2017 17:27:46 +0000 (13 19:27 +0200)
committerAndrew Borodin <aborodin@vmail.ru>
Sat, 15 Apr 2017 06:49:29 +0000 (15 09:49 +0300)
treedb1b523df30e301e844ad90f136ad3f0dac57165
parentf4eb2c47c9e558dea78e8c77a2a7dc1fea0f6c49
Ticket #3805: fix --help option to show correct syntax for editor, viewer and mcdiff

Before the patch: --help shows the same text for all tools, only "mc"
is replaced by tool name. For example, "mcedit --help" says:

        Usage:
          mcedit [OPTION...] [+number] [this_dir] [other_panel_dir]
         +number - Set initial line number for the internal editor

which is wrong: mcedit does not take [this_dir] [other_panel_dir]
syntax, that's mc syntax.

After the patch, each tool has its own syntax string shown.
"Usage:" message for each tool is as follows now:

  mc [OPTION...] [this_dir] [other_panel_dir]

  mcedit [OPTION...] [+lineno] file1[:lineno] [file2[:lineno]...]

  mcview [OPTION...] file

  mcdiff [OPTION...] file1 file2

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
src/args.c
src/args.h
src/main.c