Browse Source

Make docopt more readable

Alois Mahdal 10 years ago
parent
commit
3a44c28eb3
2 changed files with 7 additions and 7 deletions
  1. 4
    4
      gmon
  2. 3
    3
      include/gmon.py

+ 4
- 4
gmon View File

2
 
2
 
3
 """Generic mon echoer
3
 """Generic mon echoer
4
 
4
 
5
-usage: gmon [--format=<format>] [-p|--plain] [-x|--xgp] <command> [<args>...]
5
+usage: gmon [options] COMMAND [ARGS...]
6
 
6
 
7
 Options:
7
 Options:
8
-    -c, --chars     specify limit in characters
9
-    --format <format>   specify format: plain is a plain text, xgp
10
-                        is specific for xfce4-genmon-plugin
8
+    -c, --chars CHARS specify limit in characters
9
+    --format FMT    specify format: plain is a plain text, xgp
10
+                    is specific for xfce4-genmon-plugin
11
     -p, --plain     same as --format=plain
11
     -p, --plain     same as --format=plain
12
     -x, --xgp       same as --format=xgp
12
     -x, --xgp       same as --format=xgp
13
     -h, --help      show this screen
13
     -h, --help      show this screen

+ 3
- 3
include/gmon.py View File

60
             self.fmt = "plain"
60
             self.fmt = "plain"
61
         elif cmdargs['--xgp']:
61
         elif cmdargs['--xgp']:
62
             self.fmt = "xgp"
62
             self.fmt = "xgp"
63
-        self.name = cmdargs['<command>']
64
-        self.args = cmdargs['<args>']
63
+        self.name = cmdargs['COMMAND']
64
+        self.args = cmdargs['ARGS']
65
         if cmdargs['--chars']:
65
         if cmdargs['--chars']:
66
             self.maxlen = int(cmdargs['--chars'])
66
             self.maxlen = int(cmdargs['--chars'])
67
 
67
 
70
 
70
 
71
     def __init__(self, cmdargs, pluginpath):
71
     def __init__(self, cmdargs, pluginpath):
72
         self.plugindata = PluginData(cmdargs)
72
         self.plugindata = PluginData(cmdargs)
73
-        self.name = cmdargs['<command>']
73
+        self.name = cmdargs['COMMAND']
74
         self._load_plugin(pluginpath)
74
         self._load_plugin(pluginpath)
75
 
75
 
76
     def _load_plugin(self, pluginpath):
76
     def _load_plugin(self, pluginpath):