-
Notifications
You must be signed in to change notification settings - Fork 17
Go to workspace directly if you provide the name #134
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||||||||||||
| #!/bin/bash | ||||||||||||||||
|
|
||||||||||||||||
| if [ "$#" -eq 0 ]; then | ||||||||||||||||
| echo "Usage: ws_go workspace [file-system]" | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. usage info should go into separate function |
||||||||||||||||
| return | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use exit instead of return
Suggested change
|
||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| WS_OPT= | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you wanne WS_OPT to be later?
Suggested change
or
Suggested change
|
||||||||||||||||
| if [ "$#" -lt 2 ]; then | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Command line parsing should be improved - looks brittle to me. Second place. |
||||||||||||||||
| NUMWS=`ws_find $1 | wc -l` | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assign command line arguments to variables - what is |
||||||||||||||||
| if [[ ${NUMWS} -gt 1 ]]; then | ||||||||||||||||
| NUMFS=`ws_list | grep "^ filesystem name : " | cut -d ":" -f2 | cut -d" " -f2 | sort -h | uniq | wc -l` | ||||||||||||||||
| FSNAMES=`ws_list | grep "^ filesystem name : " | cut -d ":" -f2 | cut -d" " -f2 | sort -h | uniq | tr '\n' ' '` | ||||||||||||||||
|
Comment on lines
+12
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. calling |
||||||||||||||||
| echo ${NUMFS} "filesystems are available:" ${FSNAMES} | ||||||||||||||||
| echo "Please run this command with the file-system name" | ||||||||||||||||
| return; | ||||||||||||||||
| fi | ||||||||||||||||
| else | ||||||||||||||||
| WS_OPT+=" -F " | ||||||||||||||||
| WS_OPT+=`echo ${2}` | ||||||||||||||||
|
Comment on lines
+19
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not simply
Suggested change
|
||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| if ws_list ${WS_OPT} | grep "^id: " | cut -d":" -f2 | cut -d" " -f2 | grep -q $1; then | ||||||||||||||||
| cd `ws_find ${WS_OPT} $1` | ||||||||||||||||
| else | ||||||||||||||||
|
Comment on lines
+23
to
+25
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why so over complicated. Rel on
Suggested change
|
||||||||||||||||
| echo "Workspace $1 not found! Available workspaces are:" | ||||||||||||||||
| ws_list ${WS_OPT} | grep "^id: " | cut -d":" -f2 | ||||||||||||||||
| fi | ||||||||||||||||
|
Comment on lines
+27
to
+28
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was obviously an error
Suggested change
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Command line parsing should be improved - looks brittle to me. Also, should (optionally) allow -F as all other ws_* tools