gli 2.18.2 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.rdoc +26 -6
- data/bin/gli +1 -1
- data/features/gli_executable.feature +1 -1
- data/features/todo.feature +9 -9
- data/features/todo_legacy.feature +1 -1
- data/lib/gli/commands/help_modules/arg_name_formatter.rb +2 -2
- data/lib/gli/dsl.rb +1 -1
- data/lib/gli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d9dfe82dab8b65f6e40398bac8a94cac024b5cd252da184b52b00d29512b78c
|
4
|
+
data.tar.gz: 3914a6632dc595e1fda18c544665cb2ead472f41f5eeb1a4357bc4bb485f20ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af8cac9a13eaea92e7c76af8036edc21ef7f01e37efd63e475de7ce85b745e20fdcffb8d4d1bc9eff8038c5e05b298f8cc8e868cd19e7d16de0a8c7f2df7dd31
|
7
|
+
data.tar.gz: 96dd62eed7e82d5072720408df78377d603af67bf52938b4f7844a782e0a91602ad37e33a363dc8b40cab70edd45bb31b977385428d9a33e259e56f6f39c6776
|
data/README.rdoc
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
= Git-Like Interface Command Line Parser
|
1
|
+
= GLI, the Git-Like Interface Command Line Parser
|
2
2
|
|
3
|
-
GLI
|
4
|
-
simpler command-line application, check out methadone[http://www.github.com/davetron5000/methadone]).
|
5
|
-
|
6
|
-
GLI allows you to make a polished, easy-to-maintain command-line application without a lot
|
7
|
-
of syntax, but without restricting you in any way from the power of +OptionParser+.
|
3
|
+
GLI allows you to create command-line app in Ruby that behaves like <tt>git</tt> in that it takes subcommands to perform a series of complex action, e.g. <tt>git remote add</tt>.
|
8
4
|
|
9
5
|
* {Overview}[http://davetron5000.github.com/gli]
|
10
6
|
* {Source on Github}[http://github.com/davetron5000/gli]
|
@@ -12,16 +8,40 @@ of syntax, but without restricting you in any way from the power of +OptionParse
|
|
12
8
|
|
13
9
|
{<img src="https://secure.travis-ci.org/davetron5000/gli.svg?branch=gli-2" alt="Build Status" />}[https://travis-ci.org/davetron5000/gli]
|
14
10
|
|
11
|
+
== What Problem does GLI Solve?
|
12
|
+
|
13
|
+
Creating a command-line app that uses subcommands, each of which might accept different command-line options, is somewhat difficult with Ruby's built-in <tt>OptionParser</tt>. GLI provides an API that wraps <tt>OptionParser</tt> so that you can create a subcommand-based command-line app with minimal boilerplate. This API also produces complete documentation for your command-line app.
|
14
|
+
|
15
|
+
== Why is GLI's solution different from others?
|
16
|
+
|
17
|
+
There are other RubyGems that allow you to create a command-line app that takes subcommands. These solutions are often quite limited (e.g. they don't allow deeply nested subcommand structures or sophisticated command-line options per subcommand), or require more code that we think is needed. Some solutions make it difficult or impossible to properly document your command-line app.
|
18
|
+
|
19
|
+
== What you need to know to use GLI
|
20
|
+
|
21
|
+
You should know Ruby, and have a basic understanding of how the UNIX command line works: standard input, standard output, standard error, and exit codes.
|
22
|
+
|
15
23
|
== Use
|
16
24
|
|
17
25
|
Install if you need to:
|
18
26
|
|
19
27
|
gem install gli
|
20
28
|
|
29
|
+
You can validate you have installed it correctly by running <tt>gli help</tt>. You should see formatted help output.
|
30
|
+
|
31
|
+
If you are using GLI in another application, add it to your <tt>Gemfile</tt>:
|
32
|
+
|
33
|
+
gem "gli"
|
34
|
+
|
35
|
+
You can test your install via Bundler by running <tt>bundle exec gli help</tt>. This should produce formatted help output from GLI.
|
36
|
+
|
37
|
+
== Getting Started
|
38
|
+
|
21
39
|
The simplest way to get started is to create a scaffold project
|
22
40
|
|
23
41
|
gli init todo list add complete
|
24
42
|
|
43
|
+
(note if you installed via Bundler you will need to execute <tt>bundle exec gli init todo list add complete</tt>)
|
44
|
+
|
25
45
|
This will create a basic scaffold project in <tt>./todo</tt> with:
|
26
46
|
|
27
47
|
* executable in <tt>./todo/bin/todo</tt>. This file demonstrates most of what you need to describe your command line interface.
|
data/bin/gli
CHANGED
@@ -36,7 +36,7 @@ long_desc <<EOS
|
|
36
36
|
EOS
|
37
37
|
arg :project_name
|
38
38
|
arg :command_name, [:optional, :multiple]
|
39
|
-
arg_name "project_name [command_name]
|
39
|
+
arg_name "project_name [command_name]..."
|
40
40
|
command [:init,:scaffold] do |c|
|
41
41
|
|
42
42
|
c.switch :e,:ext, :desc => 'Create an ext dir'
|
@@ -49,7 +49,7 @@ Feature: The GLI executable works as intended
|
|
49
49
|
init - Create a new GLI-based project
|
50
50
|
|
51
51
|
SYNOPSIS
|
52
|
-
gli [global options] init [command options] project_name [command_name]
|
52
|
+
gli [global options] init [command options] project_name [command_name]...
|
53
53
|
|
54
54
|
DESCRIPTION
|
55
55
|
This will create a scaffold command line project that uses GLI for command
|
data/features/todo.feature
CHANGED
@@ -191,7 +191,7 @@ Feature: The todo app has a nice user interface
|
|
191
191
|
list - List things, such as tasks or contexts
|
192
192
|
|
193
193
|
SYNOPSIS
|
194
|
-
todo [global options] list [command options] [tasks] [--flag arg] [-x arg] [task]
|
194
|
+
todo [global options] list [command options] [tasks] [--flag arg] [-x arg] [task]...
|
195
195
|
todo [global options] list [command options] contexts [--otherflag arg] [-b] [-f|--foobar]
|
196
196
|
|
197
197
|
DESCRIPTION
|
@@ -261,7 +261,7 @@ Feature: The todo app has a nice user interface
|
|
261
261
|
list - List things, such as tasks or contexts
|
262
262
|
|
263
263
|
SYNOPSIS
|
264
|
-
todo [global options] list [command options] [tasks] [--flag arg] [-x arg] [task]
|
264
|
+
todo [global options] list [command options] [tasks] [--flag arg] [-x arg] [task]...
|
265
265
|
todo [global options] list [command options] contexts [--otherflag arg] [-b] [-f|--foobar]
|
266
266
|
|
267
267
|
DESCRIPTION
|
@@ -286,7 +286,7 @@ Feature: The todo app has a nice user interface
|
|
286
286
|
list - List things, such as tasks or contexts
|
287
287
|
|
288
288
|
SYNOPSIS
|
289
|
-
todo [global options] list [command options] [tasks] [--flag arg] [-x arg] [task]
|
289
|
+
todo [global options] list [command options] [tasks] [--flag arg] [-x arg] [task]...
|
290
290
|
todo [global options] list [command options] contexts [--otherflag arg] [-b] [-f|--foobar]
|
291
291
|
|
292
292
|
DESCRIPTION
|
@@ -319,7 +319,7 @@ Feature: The todo app has a nice user interface
|
|
319
319
|
list - List things, such as tasks or contexts
|
320
320
|
|
321
321
|
SYNOPSIS
|
322
|
-
todo [global options] list [command options] [tasks] [--flag arg] [-x arg] [task]
|
322
|
+
todo [global options] list [command options] [tasks] [--flag arg] [-x arg] [task]...
|
323
323
|
todo [global options] list [command options] contexts [--otherflag arg] [-b] [-f|--foobar]
|
324
324
|
|
325
325
|
DESCRIPTION
|
@@ -343,7 +343,7 @@ Feature: The todo app has a nice user interface
|
|
343
343
|
tasks - List tasks
|
344
344
|
|
345
345
|
SYNOPSIS
|
346
|
-
todo [global options] list tasks [command options] [task]
|
346
|
+
todo [global options] list tasks [command options] [task]...
|
347
347
|
todo [global options] list tasks [command options] open [--flag arg] [-x arg]
|
348
348
|
|
349
349
|
DESCRIPTION
|
@@ -370,9 +370,9 @@ Feature: The todo app has a nice user interface
|
|
370
370
|
todo [global options] create
|
371
371
|
todo [global options] create contexts [context_name]
|
372
372
|
todo [global options] create relation_1-1 first second [name]
|
373
|
-
todo [global options] create relation_1-n first second
|
374
|
-
todo [global options] create relation_n-1 first
|
375
|
-
todo [global options] create tasks task_name
|
373
|
+
todo [global options] create relation_1-n first second... [name]
|
374
|
+
todo [global options] create relation_n-1 first... second [name]
|
375
|
+
todo [global options] create tasks task_name...
|
376
376
|
|
377
377
|
COMMANDS
|
378
378
|
<default> - Makes a new task
|
@@ -530,7 +530,7 @@ Feature: The todo app has a nice user interface
|
|
530
530
|
list - List things, such as tasks or contexts
|
531
531
|
|
532
532
|
SYNOPSIS
|
533
|
-
todo [global options] list [command options] [tasks] [subcommand options] [task]
|
533
|
+
todo [global options] list [command options] [tasks] [subcommand options] [task]...
|
534
534
|
todo [global options] list [command options] contexts [subcommand options]
|
535
535
|
|
536
536
|
DESCRIPTION
|
@@ -92,7 +92,7 @@ Feature: The todo app is backwards compatible with legacy subcommand parsing
|
|
92
92
|
SYNOPSIS
|
93
93
|
todo [global options] create
|
94
94
|
todo [global options] create contexts [context_name]
|
95
|
-
todo [global options] create tasks task_name
|
95
|
+
todo [global options] create tasks task_name...
|
96
96
|
|
97
97
|
COMMANDS
|
98
98
|
<default> - Makes a new task
|
@@ -22,7 +22,7 @@ module GLI
|
|
22
22
|
arg_desc = "[#{arg_desc}]"
|
23
23
|
end
|
24
24
|
if arg.multiple?
|
25
|
-
arg_desc = "#{arg_desc}
|
25
|
+
arg_desc = "#{arg_desc}..."
|
26
26
|
end
|
27
27
|
desc = desc + " " + arg_desc
|
28
28
|
end
|
@@ -37,7 +37,7 @@ module GLI
|
|
37
37
|
desc = "[#{desc}]"
|
38
38
|
end
|
39
39
|
if arguments_options.include? :multiple
|
40
|
-
desc = "#{desc}
|
40
|
+
desc = "#{desc}..."
|
41
41
|
end
|
42
42
|
" " + desc
|
43
43
|
end
|
data/lib/gli/dsl.rb
CHANGED
@@ -50,7 +50,7 @@ module GLI
|
|
50
50
|
# command :pack do ...
|
51
51
|
#
|
52
52
|
# Produces the synopsis:
|
53
|
-
# app.rb [global options] pack output input
|
53
|
+
# app.rb [global options] pack output input...
|
54
54
|
def arg(name, options=[])
|
55
55
|
@next_arguments ||= []
|
56
56
|
@next_arguments << Argument.new(name, Array(options).flatten)
|
data/lib/gli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Copeland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|