Skip to content

Commit

Permalink
Fixed argbas-1to2 script bug
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed Aug 2, 2016
1 parent e4e2922 commit 29a9d23
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 14 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
*2.sh
*3.sh

bin/argbash-*to*

tests/regressiontests/test-standalone.sh
tests/regressiontests/test.sh

Expand Down
9 changes: 8 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
1.4.2 (2016-08-02)
------------------

Bugfixes:

* Fixed the broken `argbash-1to2` script.

1.4.1 (2016-08-02)
------------------

Expand All @@ -12,7 +19,7 @@ New features:

* Added the `ARGBASH_SET_INDENT` macro for indentation control.
* Created scripts are more compliant to the https://www.shellcheck.net/ tool.
* Introduced argbash-1to2 script for migration to Argbash2
* Introduced `argbash-1to2` script for migration to Argbash2

Bugfixes:

Expand Down
4 changes: 2 additions & 2 deletions bin/argbash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

version=1.4.1
version=1.4.2
# DEFINE_SCRIPT_DIR()
# ARG_POSITIONAL_SINGLE([input],[The input template file])
# ARG_OPTIONAL_SINGLE([output],[o],[Name of the output file (pass '-' for stdout)],[-])
Expand All @@ -12,7 +12,7 @@ version=1.4.1

# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v1.4.1 one line above ###
### START OF CODE GENERATED BY Argbash v1.4.2 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand Down
2 changes: 1 addition & 1 deletion resources/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ version:
sed -i "1s/.*/$(VERSION) ($$(date -I))/" $(CHANGELOG)
touch $(M4_SRC)

release: version $(GENPARSE) examples check
release: version $(GENPARSE) $(ARGBASH_TO) examples check
sed -i "1s/([-0-9]+)/($$(date -I))/" $(CHANGELOG)

tag:
Expand Down
2 changes: 1 addition & 1 deletion resources/examples/minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# ARG_HELP([This is a minimal demo of Argbash potential])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v1.4.1 one line above ###
### START OF CODE GENERATED BY Argbash v1.4.2 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand Down
2 changes: 1 addition & 1 deletion resources/examples/simple-standalone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# ARG_HELP()
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v1.4.1 one line above ###
### START OF CODE GENERATED BY Argbash v1.4.2 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand Down
2 changes: 1 addition & 1 deletion resources/examples/simple-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ARG_HELP([This program tells you size of files in a given directory in units you choose.])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v1.4.1 one line above ###
### START OF CODE GENERATED BY Argbash v1.4.2 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand Down
2 changes: 1 addition & 1 deletion resources/examples/simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ARGBASH_SET_INDENT([ ])
# ARGBASH_GO()
# needed because of Argbash --> m4_ignore([
### START OF CODE GENERATED BY Argbash v1.4.1 one line above ###
### START OF CODE GENERATED BY Argbash v1.4.2 one line above ###
# Argbash is a bash code generator used to get arguments parsing right.
# Argbash is FREE SOFTWARE, know your rights: https://github.com/matejak/argbash

Expand Down
4 changes: 3 additions & 1 deletion src/argbash-1to2.m4
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ version=_ARGBASH_VERSION

do_stuff ()
{
sed 's/\(_ARG_\w\+\)/\L\1\l/g' "$_ARG_INPUT"
# We match $_ARG_FOO as well as ${ARG_FOO...
# and _ARGS_FOO
sed 's/\(\${\?_ARGS\?_\w\+\)/\L\1\l/g' "$infname"
}

outfname="$_ARG_OUTPUT"
Expand Down
7 changes: 5 additions & 2 deletions src/stuff.m4
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ m4_define([_translit], [m4_translit(m4_translit([$1], [a-z], [A-Z]), [-], [_])])
dnl
dnl The operation on command names that converts them to variable names (where command values are stored)
m4_define([_varname], [_arg_[]_translit([$1])])
m4_define([_varname], [_ARG_[]_translit([$1])])
m4_define([_arg_prefix], [[_arg_]])
m4_define([_arg_prefix], [[_ARG_]])
m4_define([_args_prefix], [[_args_]])
m4_define([_args_prefix], [[_ARGS_]])
m4_define([_varname], [_arg_prefix[]_translit([$1])])
dnl
Expand Down
2 changes: 1 addition & 1 deletion src/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.1
1.4.2

0 comments on commit 29a9d23

Please sign in to comment.