Skip to content

Conversation

@ccoulombe
Copy link
Contributor

Avoid abusing only specific commands (sq, squeue, and sacct) and defer to the original command otherwise.

Does not intercept other arguments except --interval. Use the same default values. Set interval minimally at 61 seconds or user provided value.

Side note: this will save some time for @mnnguyen

To test/tested

#alias watch="$PWD/watch"
#export OVERRIDE_WATCH_BIN=$(which watch)

# defer to original using its default interval
./watch
./watch ls
./watch ls squeue # if a directory has a command name

# does not impair default behavior
./watch -p ls
./watch -n 34 -p ls
./watch -c -n 200 ls -h

# wrap specific commands to 61s minimally
./watch -n 34 sq
./watch -n 34 squeue
./watch -n 34 sacct
./watch -c -n 34 sacct
./watch -c -n 200 sq
./watch --color -n 5 -- sq -u bob
./watch --color -n 5 -- squeue
./watch --color -n 5 -- sacct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants