Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from original - master #1

Open
wants to merge 231 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
c988c13
Added support for the upcoming `options_first` argument and implemen…
Dec 17, 2012
cbf0014
The table of contents didn't look so nice on GitHub.
Dec 17, 2012
78ba862
Forgot to replace the old arguments in the documentation here
Dec 17, 2012
17d0b17
Changed PATH to $PATH and deleted unnecessary space
Jan 9, 2013
1c4895f
Changed -- to : in the usage pattern
Jan 9, 2013
867ab4f
I think docopts is zipsafe?
Jan 25, 2013
73806d1
Update the year in the license file too
Jan 25, 2013
8334cb7
Switch to the new language agnostic testing system
Jan 25, 2013
6a46213
Prepare for 0.6.0 release
Jan 25, 2013
afc0993
Changed this to reflect README.rst better
Jan 25, 2013
082d872
Fixed invoking docopts with invalid or missing arguments
Jan 26, 2013
2cecbc9
Now testes with python3.3, too
Jan 26, 2013
90287d4
Bump version number up to 0.6.1 to match docopt
Feb 5, 2013
bb43943
Looks like I forgot to actually add options_first to the client docop…
Feb 6, 2013
3c8dab5
Just stdout is clearer than sys_stdout
Feb 6, 2013
72d7d79
Removed useless file_get_contents function
Feb 6, 2013
cb1c01d
Cut the INSTALLATION section if we're playing at being a man page
Feb 6, 2013
0bcd17b
Let's not leave any UNKNOWNs in PKGINFO
Feb 6, 2013
ad3686c
Bump version information for imminent release
Feb 6, 2013
4cc14d1
Switched order of import tests
Feb 17, 2013
2da9c38
Added caution against using in shell functions
May 3, 2013
9f1ddd1
Added warning about 0.7.0
May 14, 2013
4c8b652
Made the grep example more amenable to copypasting
Dec 10, 2013
c292cc8
first copy / paste from #7
Sylvain303 Mar 13, 2015
40eed46
add API_proposal.sh and a converted example
Sylvain303 Mar 13, 2015
4e0bbef
Update API_proposal.md
Sylvain303 Mar 13, 2015
61a918c
add some tests and docopts.sh plus various files
Sylvain303 Mar 14, 2015
880de96
Merge branch 'shell-api-v2' of https://github.com/Sylvain303/docopts …
Sylvain303 Mar 14, 2015
4492bc9
add more examples, still using old docopts.py
Sylvain303 Mar 15, 2015
87cdbf9
add bash helpers to prefecth repeatable arguments
Sylvain303 Mar 15, 2015
13c548c
add experimental embedded docopts.py inside.
Sylvain303 Mar 16, 2015
5b8ebe5
add --auto feature for generic parsing
Mar 17, 2015
39a0214
import original docopt.py from github master
Sylvain303 Mar 17, 2015
2d6cd5b
copy original docopts into docopts.py
Sylvain303 Mar 17, 2015
3f26a44
remove unused shell function
Sylvain303 Mar 17, 2015
9dfee6a
add builder for embedded version
Sylvain303 Mar 17, 2015
d13cd1a
add example with --auto
Sylvain303 Mar 17, 2015
6bada2c
remove python3 explicit call
Mar 17, 2015
e1fc19d
remove harcode python3 and build on legacy server
Mar 17, 2015
c26ca3c
typo correct example of usage ( array )
Sylvain303 Mar 19, 2015
4088846
Merge branch 'shell-api-v2' of https://github.com/Sylvain303/docopts …
Sylvain303 Mar 19, 2015
8ab4fda
documentation change before pull request
Sylvain303 Mar 19, 2015
6f28199
add rock example from docopts/README.rst
Sylvain303 Mar 22, 2015
112a555
re add docopt_get_help_string + format space
May 13, 2018
4cb0800
rebuild all
May 13, 2018
06327f6
initial golang draft commit
May 14, 2018
37658dc
golang version update
May 14, 2018
429db7e
remove executable docopts will be build as a binary
May 14, 2018
97aa4fc
to_be_deleted python code, fixed unit test for go
May 15, 2018
615b939
fix some quoting mistake
May 15, 2018
e4bbb0d
fix minor bug handling unpassed args
May 16, 2018
c34b3f8
adapt error message on exit status failure
May 20, 2018
7b79c14
add stdin and pass some testcases.docopts 156/175
May 20, 2018
66e66c0
fix stdin + colon old separator, all test fixed
May 21, 2018
170e6a8
fix testee counter string output, add --no-mangle
May 22, 2018
e046669
fixed all test in language_agnostic_tester.py
May 22, 2018
07c14b4
get_raw_value testee renamed
May 22, 2018
f8067c7
completed update README
Sylvain303 May 22, 2018
5c0681f
add first unit tests
May 22, 2018
39ea90e
add first go unit tests OK
May 24, 2018
ac9b293
refactor for unit test in go, OK
May 27, 2018
db830cd
add -G prefix for -9 handling
May 27, 2018
e6f78c3
Merge branch 'docopts-go' of https://github.com/Sylvain303/docopts in…
May 27, 2018
9662e57
refactor docopts.sh + testee with get_raw_value
May 27, 2018
35e4fec
fix all examples OK
May 28, 2018
621d9a1
updated doc and removed old code
May 29, 2018
4cfaa1f
add more examples and fix some doc or TODO
Jun 3, 2018
3db0d2e
rewrite .py => .sh
Jun 3, 2018
f0d97bd
link to issues on docopts main repos
Sylvain303 Jun 3, 2018
a797c86
add CI travis yaml first version
Jun 4, 2018
612f9c5
add build scripts used to produce firt release.
Jun 4, 2018
db9949d
pre-built binary are attached to releases
Sylvain303 Jun 11, 2018
730fc0a
add Makefile to build 4 primary easy target
Jun 12, 2018
0769bd4
Merge branch 'docopts-go' of https://github.com/Sylvain303/docopts in…
Jun 12, 2018
aba19ff
modified README add reference to Makefile
Jun 12, 2018
d2b98ed
prepare to test merge into official docopts repos
Jun 16, 2018
f89156c
remove commited binary
Jun 16, 2018
01222ba
commit another exemple
Jun 16, 2018
031ceb2
docopts go version merge (#13)
Sylvain303 Jun 18, 2018
2426835
add new test for github
Jun 19, 2018
fc7c9bf
add release fetch tool
Jun 19, 2018
e771179
add project parameter
Jun 19, 2018
e583f33
renamed path to forked version
Jun 20, 2018
1155e81
wrap readlink for support of non-GNU OS. (#14)
FlorianHeigl Jun 20, 2018
d70f158
revome exec perm on source
Jun 20, 2018
74b4c30
new In PROGRESS.md
Jun 20, 2018
56a31c0
Merge remote-tracking branch 'docopts/master' into docopts-go
Jun 21, 2018
5d65549
add without_docopts_sh_lib examples
Jun 21, 2018
708f9da
Merge branch 'docopts-go' of https://github.com/Sylvain303/docopts in…
Jun 21, 2018
5f896b3
simple fix cloned repos go fullpath import
Jun 21, 2018
cc52386
Merge branch 'master' of https://github.com/docopt/docopts into docop…
Jun 21, 2018
dda543f
test updating bash with brew on travis for OSX
Jun 21, 2018
1585029
looking for bash path on travis + brew
Jun 21, 2018
673f105
OSX fix testee bash4 pass for travis
Jun 21, 2018
b2a34ad
OSX fix bash4 path
Jun 21, 2018
71d41a6
OSX debug test bats bash4 env
Jun 21, 2018
07b2a0a
add example legacy
Jun 27, 2018
b441420
Merge branch 'master' of https://github.com/docopt/docopts
Jun 27, 2018
e4ff594
Merge branch 'docopts-go'
Jun 27, 2018
935f648
Added 'install' target to Makefile.
dexpota Jan 4, 2019
77e6561
Fixed type inside Makefile
dexpota Jan 4, 2019
5ebe426
Merge branch 'dexpota-master'
Jan 14, 2019
4029651
merge old Doc and README, helps on #24
May 18, 2019
84bdcff
color bash syntaxe missing
Sylvain303 May 18, 2019
0d8efb4
update to work on bash 3.2 and macOS
rdonkin May 19, 2019
51366eb
examples for bash 3.x
rdonkin May 19, 2019
76a587c
fix paths in legacy_bash examples
rdonkin May 19, 2019
2fa3bf2
fix finding full path to docopts.sh
rdonkin May 19, 2019
e6cb7c7
minor README updates (#26)
rdonkin May 20, 2019
fda4450
fix with/without phrase for -G in doc + README
May 20, 2019
ebf6f8e
fixes for docopts.go usage and README
rdonkin May 20, 2019
81865c7
update to work on bash 3.2 and macOS
rdonkin May 19, 2019
73bde77
examples for bash 3.x
rdonkin May 19, 2019
9a5982b
fix paths in legacy_bash examples
rdonkin May 19, 2019
a9b4817
fix finding full path to docopts.sh
rdonkin May 19, 2019
18b1479
Fixed install target. (#29)
dexpota May 23, 2019
dab1ec9
fixes for docopts.go usage and README (#28)
rdonkin May 23, 2019
698d30b
Merge branch 'feat-bash-3.2-support' of https://github.com/rdonkin/do…
May 23, 2019
ffc2602
fix regex for use with macOS
rdonkin May 23, 2019
7356b70
test for help string including Options section
rdonkin May 24, 2019
23568eb
add build_doc.sh first working GNU/Linux
May 24, 2019
3e6c28e
add experimental global support for auto parse
May 26, 2019
8bf35c7
Merge branch 'feat-bash-3.2-support' of https://github.com/rdonkin/do…
May 26, 2019
084b556
Merge branch 'feat-test-with-options-section' of https://github.com/r…
May 26, 2019
3f36ddb
progress on -G for helper.
May 27, 2019
1bcab3a
add test for -G globals
May 29, 2019
aefb0c5
test travis remote login macos
Jun 2, 2019
4660337
try ssh to bounce host with key pair
Jun 2, 2019
42ed40f
install key in authorized
Jun 2, 2019
8148f10
more complete make build_doc parsing with type
Jun 6, 2019
cd05e64
commit build_doc directive in README
Jun 7, 2019
0ad78be
fixing #24 and changing shebangs
Jun 7, 2019
93c6a51
restore travis all steps
Jun 7, 2019
89e001c
try to fix sed for macos
Jun 7, 2019
95df754
removing git submodule tests/bats before change
Jun 7, 2019
db54f05
change submodule to Bats 1.1.0 from bats-core
Jun 7, 2019
53923f9
PROGRESS update
Jun 7, 2019
82b28fd
fix docopts PATH in build_doc
Jun 8, 2019
1156d73
Enable use of 'set -u' (#33)
rdonkin Jun 8, 2019
e4bc666
README updates on 'set -u', bash 3.2, etc
rdonkin Jun 8, 2019
d684e0a
fix typo
rdonkin Jun 8, 2019
081bac0
update PROGRESS
Jun 8, 2019
11bfb54
Merge branch 'docs-set-u' of https://github.com/rdonkin/docopts into …
Jun 8, 2019
28227f1
README changes
rdonkin Jun 9, 2019
94411ce
refactor build_doc markup change
Jun 9, 2019
c15d2b7
Merge branch 'docs-set-u' of https://github.com/rdonkin/docopts into …
Jun 9, 2019
58f8743
merged and modified documentation
Jun 25, 2019
82979f9
link fix typo makrdown
Sylvain303 Jun 25, 2019
7eee640
add small draft deploy scripts for #32
Jul 31, 2019
e038d3f
loop + sha256sum generation + replace #32
Jul 31, 2019
6518ec7
add deployment documentation, unchanged draft #32
Aug 1, 2019
92891dc
Merge branch 'master' of https://github.com/docopt/docopts
Aug 1, 2019
cf2e17e
fix build_doc.sh markup extration with colon inside
Aug 2, 2019
a3524cb
fix bash strict mode support with docopt_print_ARGS
Aug 2, 2019
8ece2d0
Drafting deploy.sh most code OK. #32
Aug 2, 2019
5bd515e
deploy.sh code release git deploy #32
Aug 2, 2019
13f0bbc
commit for v0.6.3-rc1 tag #32
Aug 5, 2019
f5ae684
published binaries v0.6.3-rc1 #32
Aug 5, 2019
75c2dfa
add -u for chosing GITHUB_USER #32
Aug 5, 2019
2572fdf
import deploy.sh from branch dev-docopt_sh 0e310a7
Aug 18, 2019
d2ebe11
get binaries from official repo, close #37
avaldebe Sep 4, 2019
4fd40aa
typo
avaldebe Sep 4, 2019
5981d5a
Merge branch 'patch-1' of https://github.com/avaldebe/docopts into av…
Sep 8, 2019
a4fd178
rewrite using default assignment #37
Sep 8, 2019
d17b7bc
try some travis changes
Sep 9, 2019
3890e5b
add skip on "$TRAVIS_OS_NAME" == "osx" #39
Sep 10, 2019
ba51c14
see what append on travis host for macos
Sep 10, 2019
5915a94
debug macos skip bats failure
Sep 12, 2019
c682937
debug: failed sleep argument missing
Sep 12, 2019
e31455a
debug ci: retry remote connection with correction
Sep 12, 2019
2cf8710
debug ci: moved darwin detection in setup() for bats
Sep 12, 2019
94f7cc2
this fix #39 skipping build_doc test on macOS
Sep 12, 2019
57f1ce1
add functionnal test for get_doctops.sh #39
Sep 12, 2019
49989a7
add test for changing github repository #39
Sep 12, 2019
a5f89d0
update PROGRESS and TODO
Sep 17, 2019
c3c48f6
Update README.md (#41)
nkakouros Oct 24, 2019
489ab2a
Merge branch 'master' of https://github.com/docopt/docopts
Apr 1, 2020
f9f7460
try correction for #44 and travis for macos
Apr 1, 2020
e093941
refactor tests/get_doctops.bats
Apr 2, 2020
a41917a
install bats-core on travis
Apr 2, 2020
4b6f4f7
travis try install with sudo
Apr 2, 2020
ea0011a
travis debug bash brew and after_script:
Apr 2, 2020
b3312e9
travis test our bash5 hack remove submodules bats
Apr 3, 2020
af29fbd
travis bash5 hack use travis var to get build dir
Apr 3, 2020
be827a5
travis macos bash5 hack deploy test
Apr 3, 2020
8b1b4e1
travis macos bash add exec perm
Apr 3, 2020
388334a
all work for release v0.6.3-rc2
Apr 3, 2020
8c344ce
prepare release v0.6.3-rc2
Apr 3, 2020
6eb9852
prepare release v0.6.3-rc2 macos get_docopts.sh
Apr 3, 2020
a599fb7
travis test correct double Usage:
Apr 4, 2020
4678d5a
travis test for macos
Apr 4, 2020
902ae74
add modified deployment.yml before test deploy.sh
Apr 4, 2020
f4a58ba
correct macos awk call for docopt_get_help_string()
Apr 4, 2020
62734fc
pre-release v0.6.3-rc2 retag for deploy
Apr 4, 2020
791ff6e
pre-release commit all changes
Apr 5, 2020
e83355b
pre-release push on doctops master for travis build
Apr 5, 2020
651ff2c
release v0.6.3-rc2
Apr 5, 2020
6565302
finished publish + typo in comment
Apr 5, 2020
c211513
fix extracting help string with mawk
Sylvain303 Dec 6, 2020
c142266
Fix typo (#51)
phillmac Jul 13, 2021
ba8a068
Do not try to mangle double dash
Aug 25, 2021
cdc9d81
Merge branch 'master' of https://github.com/docopt/docopts
Sep 8, 2021
d63c3c7
add BUILD instruction and changed Dockerfile #52
Sep 8, 2021
e55fd9d
Update BUILD.md
Sylvain303 Sep 8, 2021
83d281f
Fix silly PEBKAC error
Sep 8, 2021
75eed4f
Merge remote-tracking branch 'dana-lacoste/do-not-publish-double-dash…
Sep 9, 2021
229961b
refactor -- skip + gofmt tabs changes
Sep 9, 2021
f96f6a2
Merge branch 'pr-52-double-dash-no-mangle' of github.com:docopt/docop…
Sep 9, 2021
4f208e8
add test for pr #52 and refactor involved code
Sep 11, 2021
688bc9d
continue to document developer.md + example
Sep 13, 2021
6ca39df
commit README before automated changes
Sep 14, 2021
8e8c077
pr52 add more document + introduce output for -G
Sep 14, 2021
6653ca5
prepare release v0.6.4-with-no-mangle-double-dash
Sep 15, 2021
2844dcd
all final code before release, fix #52
Sep 15, 2021
e7d60ea
fix #53 handle bash empty array correctly
Sep 15, 2021
ccd24b6
final commit in branch before merge to master
Sep 16, 2021
7734af6
new API proposal / roadmap?
Sep 16, 2021
4130f5b
typo and describe -G mode with -- and -
Sylvain303 Sep 17, 2021
d409329
Merge branch 'master' of github.com:docopt/docopts
Sep 17, 2021
d9630c0
updated TODO
Sep 17, 2021
d0d339b
error message example in TODO
Sep 17, 2021
94d2e8f
add more proposal to API_proposal.md
Sep 17, 2021
70841b4
more error use case
Sep 18, 2021
1ac859f
light build documentation update using deploy.sh
Apr 16, 2022
c3dcdf2
typo docpots => docopts
Apr 19, 2022
e908483
increase year to 2022 in copyleft
Apr 24, 2022
2b51559
typo in command FILLE => FILE
Apr 24, 2022
d3a457a
ci: migrate from Travis CI to GitHub Actions (#62)
agilgur5 Aug 24, 2022
94099bb
ci: install bash5 on macOS via Brew w/ no auto-update (#63)
agilgur5 Aug 25, 2022
190c0f2
optim(ci): clone `bats-core` with `--depth=1` (#64)
agilgur5 Sep 9, 2022
62aed3d
ci: rename `travis` -> `ci` and modify CI docs (#66)
agilgur5 Sep 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI
on:
pull_request:
branches: [master]
push:
branches: [docopts-go, master]

jobs:
ci:
name: CI - Go ${{ matrix.go-version }}, ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: ["1.14"]
os: [ubuntu-latest, macOS-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
# cache: true # TODO: cache needs path to go.sum per https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs
- name: Install
run: |
bash --version ; type bash
# hack for speedup on mac build with our own bash5
./ci/get_bash5_macos.sh
./ci/get_bats-core.sh
go get github.com/docopt/docopt-go
# get our official repos too
go get github.com/docopt/docopts
- name: Test
run: make test

# For debugging, create reverse SSH tunnel (this should be run on failure too)
# - name: Debug
# if: runner.os == "macOS"
# run: bash -x ./ci/reverse_ssh_tunnel.sh
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
dist
docopts.egg-info
docopts
*.swp
env
build/docopts_*
build/docopts.go
68 changes: 68 additions & 0 deletions API_proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# New API proposal for docopts - docopt on shell (bash)

## Update: 2021-09-16

[docopts.sh](docopts.sh) has been publised as a `docopts` companion its documentation live here:
[docs/README.md](docs/README.md).

It offer some API alternatives and allow to build external wrapper.

## new cli API proposal for 2021

* use verb for action
* stop using `-h` `<msg>` for reading help
* keep compatibily with old syntax trough a new verb: `compat`
* introduce more useful error message


### new verb

### replace `-h`

```
Usage:
docopts [options] parse USAGE : [<argv>...]
docopts [options] parse [--no-declare] -A <name> USAGE : [<argv>...]
docopts [options] parse -G <prefix> USAGE : [<argv>...]
```

Example:

```
docopts parse "$USAGE" : <option passed here>
```

`-h` still available trough `compat`

```
docopts compat -h "$USAGE" : <option passed here>
```

### generate usage completion

generate usage completion (as `kubect completion` done by [cobra](https://github.com/spf13/cobra/blob/master/shell_completions.md))

```
docopts completion "$usage"
```

### debug mode:

```
Usage:
docopts debug [--explain-parsed] USAGE : [<argv>...]
docopts debug [--show-argument-match] USAGE : [<argv>...]
```

### `docopt.sh` compatibile generator

```
Usage:
docopts generate USAGE
docopts generate -f FILENAME
```


## Dropped JSON API proposal

old [API_proposal.md](https://github.com/docopt/docopts/blob/031ceb2f0700ac0e40303d72167b91586a6d60da/API_proposal.md)
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Change history

See deployment.yml

2 changes: 1 addition & 1 deletion LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012 Vladimir Keleshev, <[email protected]>
Copyright (c) 2013 Vladimir Keleshev, <[email protected]>
Lari Rasku, <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
Expand Down
61 changes: 61 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
# Makefile for managing docopts build
#
# See also: deploy.sh

PREFIX ?= /usr/local

# keep docopts: as first target for development

# govvv define main.Version with the contents of ./VERSION file, if exists
BUILD_FLAGS=$(shell ./get_ldflags.sh)
docopts: docopts.go Makefile
go build -o $@ -ldflags "${BUILD_FLAGS} ${LDFLAGS}"

# dependancies
install_builddep:
go get github.com/docopt/docopts
go get github.com/docopt/docopt-go
go get github.com/mitchellh/gox
go get github.com/itchio/gothub
go get gopkg.in/yaml.v2
go get github.com/ahmetb/govvv

all: install_builddep docopts README.md
./deploy.sh build current

############################ cross compile, we use gox now inside deploy.sh

## build 32 bits version too
#docopts-32bits: docopts.go
# env GOOS=linux GOARCH=386 go build -o docopts-32bits docopts.go
#
## build for OSX
#docopts-OSX: docopts.go
# env GOOS=darwin go build -o docopts-OSX docopts.go
#
## build 32 bits version too
#docopts-arm: docopts.go
# env GOOS=linux GOARCH=arm go build -o docopts-arm docopts.go

###########################

# requires write access to $PREFIX
install: all
install -m 755 docopts $(PREFIX)/bin
install -m 755 docopts.sh $(PREFIX)/bin

test: docopts
./docopts --version
go test -v
python3 language_agnostic_tester.py ./testee.sh
cd ./tests/ && bats .

# README.md is composed with external source too
# Markdown hidden markup are used to insert some text form the dependancies
README.md: examples/legacy_bash/rock_hello_world.sh examples/legacy_bash/rock_hello_world_with_grep.sh docopts build_doc.sh
./build_doc.sh README.md > README.tmp
mv README.tmp README.md

clean:
rm -f docopts-* docopts README.tmp build/*
18 changes: 18 additions & 0 deletions PROGRESS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# current work in PROGRRESS

## releasing v0.6.3-rc2

- finish release in docs/release.md
- OK: tests/get_doctops.bats DRY previous VERSION
- OK: fix: not ok 21 docopt_get_help_string on macos

## grammar programming

Testing https://github.com/alecthomas/participle

## provide test on old environment

docker?
32bits
bash 3

Loading