Wed, 04 Jul 2012 07:51:35 +0200
clix.archive: Be interactive when --interactive is set. --everything makes it page by itself.
0 | 1 | return function (opts, arg) |
27
5b58c002d6ad
clix.*: Add --short-help and make sure they are working correctly
Matthew Wild <mwild1@gmail.com>
parents:
0
diff
changeset
|
2 | if opts.short_help then |
5b58c002d6ad
clix.*: Add --short-help and make sure they are working correctly
Matthew Wild <mwild1@gmail.com>
parents:
0
diff
changeset
|
3 | print("Query for the software of a client/server"); |
5b58c002d6ad
clix.*: Add --short-help and make sure they are working correctly
Matthew Wild <mwild1@gmail.com>
parents:
0
diff
changeset
|
4 | return; |
5b58c002d6ad
clix.*: Add --short-help and make sure they are working correctly
Matthew Wild <mwild1@gmail.com>
parents:
0
diff
changeset
|
5 | end |
0 | 6 | if #arg == 0 or opts.help then |
7 | return 0; | |
8 | end | |
9 | local conn; | |
10 | local function on_reply(reply) | |
11 | if not reply.error then | |
12 | if reply.name then | |
13 | print("Software:", reply.name); | |
14 | end | |
15 | if reply.version then | |
16 | print("Version:", reply.version); | |
17 | end | |
18 | if reply.platform then | |
19 | print("Platform:", reply.platform); | |
20 | end | |
21 | else | |
22 | print("Error requesting version ("..(reply.condition or "unknown")..")"..(reply.text and (": "..reply.text) or "")); | |
23 | end | |
24 | conn:close(); | |
25 | end | |
26 | local function on_connect(_conn) | |
27 | conn = _conn; | |
28 | conn:add_plugin("version"); | |
29 | conn:query_version(arg[1], on_reply); | |
30 | end | |
31 | clix_connect(opts, on_connect); | |
32 | end |