Skip to content

Commit

Permalink
Consider the notion of private goals #31
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Aug 17, 2021
1 parent 02f9b46 commit 9a3131b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
10 changes: 6 additions & 4 deletions makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ function prepareArgs( i,arg) {
print "Usage: makesure [options...] [-f buildfile] [goals...]"
print " -f,--file buildfile"
print " set buildfile to use (default Makesurefile)"
print " -l,--list list all available goals"
print " -l,--list list non-@private available goals"
print " -la,--list-all list all available goals"
print " -d,--resolved list resolved dependencies to reach given goals"
print " -D \"var=val\",--define \"var=val\""
print " override @define values"
Expand Down Expand Up @@ -262,18 +263,19 @@ function registerReachedIf(goal_name, pre_script) {

function doWork(\
i,j,goal_name,dep_cnt,dep,reached_if,reached_goals,empty_goals,defines_line,
body,goal_body,goal_bodies,resolved_goals,exit_code, t0,t1,t2, goal_timed) {
body,goal_body,goal_bodies,resolved_goals,exit_code, t0,t1,t2, goal_timed, list) {

started("end") # end last directive

if (Error)
dieMsg(Error)

if ("-l" in Args || "--list" in Args) {
list="-l" in Args || "--list" in Args
if (list || "-la" in Args || "--list-all" in Args) {
print "Available goals:"
for (i = 0; i < arrLen(GoalNames); i++) {
goal_name = GoalNames[i]
if (GoalsByName[goal_name]) # private
if (list && GoalsByName[goal_name]) # private
continue
printf " "
if (goal_name in Doc)
Expand Down
3 changes: 2 additions & 1 deletion tests/0_basic.tush
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ $ cd "$MYDIR/tests/emptydir"; ../../makesure -h
| Usage: makesure [options...] [-f buildfile] [goals...]
| -f,--file buildfile
| set buildfile to use (default Makesurefile)
| -l,--list list all available goals
| -l,--list list non-@private available goals
| -la,--list-all list all available goals
| -d,--resolved list resolved dependencies to reach given goals
| -D "var=val",--define "var=val"
| override @define values
Expand Down
8 changes: 8 additions & 0 deletions tests/15_private.tush
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ $ cd "$MYDIR"; ./makesure -f tests/15_private.sh -l
| a
| 15_private.sh

$ cd "$MYDIR"; ./makesure -f tests/15_private.sh --list-all
| Available goals:
| a
| b
| 15_private.sh
| 15_private.tush


0 comments on commit 9a3131b

Please sign in to comment.