22
33[ docopt] ( http://docopt.org/ ) for shell - make beautiful CLI with ease.
44
5- Status: Alpha - work is done .
5+ Status: working .
66
77` docopts ` : the command line wrapper for bash.
88
@@ -14,10 +14,10 @@ GNU/Linux OS.
1414[ make README.md ] : # ( ./docopts --version | get_version "This is a transitional release:" )
1515
1616```
17- This is a transitional release: docopts 0 .6.3
17+ This is a transitional release: v0 .6.3-rc1
1818```
1919
20- This release will be maintained for compatibility, only fixes will be provided. The 0.6.2 version is fully compatible with
20+ This release will be maintained for compatibility, only fixes will be provided. The 0.6.3 version is fully compatible with
2121the previous version of ` docopts ` .
2222
2323## SYNOPSIS
@@ -286,24 +286,37 @@ cp docopts docopts.sh /usr/local/bin
286286
287287### Pre-built binaries
288288
289- Pre-built Go binaries for GNU/Linux (32 and 64 bits) are attached to [ releases] ( https://github.com/Sylvain303 /docopts/releases ) .
289+ Pre-built Go binaries for GNU/Linux (32 and 64 bits) are attached to [ releases] ( https://github.com/docopt /docopts/releases ) .
290290
291- Download and rename to ` docopts ` and put it in your ` PATH ` :
291+ We provide a download helper :
292292
293+ ``` bash
294+ git clone https://github.com/docopt/docopts.git
295+ cd doctops
296+ ./get_docopts.sh
293297```
294- mv docopts-32bit docopts
298+
299+ Rename to ` docopts ` and put it in your ` PATH ` :
300+
301+ ``` bash
302+ mv docopts_linux_amd64 docopts
295303cp docopts docopts.sh /usr/local/bin
296304```
297305
298- You are strongly encouraged to build your own binary, which is easy once
299- you have Go installed. Or find a local golang developer that you
300- trust and ask her, in exchange for a beer or two, if she could build it for you. ;)
306+ The cloned repository is no more used at this stage.
307+
308+ Learn more about [ pre-built binaries ] ( docs/pre_built_binaries.md ) .
301309
302310## Compiling
303311
304- Requires a directory to use as a [ Go workspace] ( https://golang.org/doc/code.html#Organization ) .
312+ We encourage you to build your own binary, which is easy once
313+ you have Go installed. Or find a local golang developer that you
314+ trust and ask her, in exchange for a beer or two, if she could build it for you. ;)
315+
316+ Requires a [ Go workspace] ( https://golang.org/doc/code.html#Organization ) .
305317
306318local build:
319+ (also done with our Makefile default target: ` make ` )
307320
308321```
309322go get github.com/docopt/docopt-go
@@ -318,119 +331,39 @@ cross compile for 32 bit:
318331env GOOS=linux GOARCH=386 go build docopts.go
319332```
320333
321- or via Makefile (generates 64 bit, 32 bit, arm and macOS-64bit versions of docopts)
334+ or via Makefile:
322335
323336```
324337cd src/github.com/docopt/docopts
325338make all
326339make test
327340```
328341
329- Tested builds are built on: ` go version go1.11.4 linux/amd64 `
342+ Tested builds are built on:
343+
344+ [ make README.md ] : # ( go version )
345+
346+ ```
347+ go version go1.11.4 linux/amd64
348+ ```
330349
331350## Features
332351
333352Warning: may be not up-to-date feature list.
334353
335354The [ ` docopts.sh ` ] ( docopts.sh ) helper is an extra bash library that you can source in your shell script.
336- This library provides some bash helpers and is not required in order to use ` docopts ` .
355+ This library provides some bash helpers and is not required in order to use ` docopts ` . See [ docopts.sh
356+ documentation] ( docs/README.md ) .
337357
338- You don 't need a python interpreter anymore, so it works on any legacy system.
358+ ` docopts ` doesn 't need a python interpreter anymore, so it works on any legacy system too .
339359
340360As of 2019-05-18
341361
342362* ` docopts ` is able to reproduce 100% of the python version.
343- * unit tests for go are provided, so hack as you wish.
344- * 100% of ` language_agnostic_tester.py ` tests pass (GNU/Linux 64bits)
363+ * unit tests for Go are provided, so hack as you wish.
364+ * 100% of ` language_agnostic_tester.py ` tests pass (GNU/Linux 64bits).
365+ * ` bats-core ` unittests and fonctional testing are provided too.
345366
346367## Developers
347368
348- All python related stuff has been removed, excepted ` language_agnostic_tester.py ` .
349-
350- If you want to clone this repository and hack ` docopts ` :
351-
352- Use ` git clone --recursive ` , to get submodules - these are only required for testing with ` bats ` .
353- If [ ` bats-core ` ] ( https://github.com/bats-core/bats-core ) installed in your PATH should work too.
354-
355- Fetch the extra golang version of ` docopt-go ` (required for building ` docopts ` )
356-
357- ```
358- go get github.com/docopt/docopt-go
359- ```
360-
361- If you forgot ` --recursive ` , you can also run it afterwards:
362-
363- ~~~ bash
364- git submodule init
365- git submodule update
366- ~~~
367-
368- Current folder structure:
369-
370- ~~~
371- .
372- ├── docopts.go - main source code
373- ├── docopts_test.go - go unit tests
374- ├── docopts.sh - library wrapper and helpers
375- ├── examples - many ported examples in bash, all must be working
376- ├── language_agnostic_tester.py - old python JSON tester still used with testee.sh
377- ├── LICENSE-MIT
378- ├── PROGRESS.md - what I'm working on
379- ├── README.md
380- ├── testcases.docopt - agnostic testcases copied from python's docopt
381- ├── testee.sh - bash wrapper to convert docopts output to JSON (now uses docopts.sh)
382- ├── tests - unit and functional testing written in bats (requires submodule)
383- └── TODO.md - Some todo list on this golang version of docopts
384- ~~~
385-
386- ## Tests
387-
388- Some tests are coded along with this code base:
389-
390- - bats - bash unit tests and functional testing.
391- - ` language_agnostic_tester.py ` - old python wrapper, full docopt compatibility tests.
392- - See also: [ docopt.go] ( https://github.com/docopt/docopt.go ) has its own tests in golang.
393- - ` docopts_test.go ` - go unit test for ` docopts.go `
394-
395- ### Running tests
396-
397- ```
398- make test
399- ```
400-
401- #### bats
402-
403- ` bats.alias ` modify your current environment to define a alias on the submodule of ` bats ` installed (if you did it).
404-
405- ```
406- cd ./tests
407- . bats.alias
408- bats .
409- ```
410-
411- #### ` language_agnostic_tester `
412-
413- This script was provided with the original ` docopts ` . I fixed number/string output parsing failure with an extra function
414- for bash in [ docopts.sh] ( https://github.com/docopt/docopts/blob/docopts-go/docopts.sh#L108 )
415- ` docopt_get_raw_value() ` . This is a hack to get 100% pass, and it is not very efficient.
416-
417- Run these tests from top of repo:
418- ```
419- python language_agnostic_tester.py ./testee.sh
420- ```
421-
422- #### golang docopt.go (golang parser lib)
423-
424- This lib is outside this project, but it is the base of the ` docopt ` language parsing for this wrapper.
425-
426- ```
427- cd PATH/to/go/src/github.com/docopt/docopt-go/
428- go test -v .
429- ```
430-
431- #### golang docopts (our bash wrapper)
432-
433- ```
434- cd PATH/to/go/src/github.com/docopt/docopts
435- go test -v
436- ```
369+ Read the [ doc for developer] ( docs/developer.md ) .
0 commit comments