Skip to content

Commit

Permalink
update wb_shortcuts, minor wording change
Browse files Browse the repository at this point in the history
  • Loading branch information
coalsont committed Aug 24, 2016
1 parent 10e9470 commit c170db0
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Algorithms/AlgorithmCiftiSeparate.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void AlgorithmCiftiSeparate::useParameters(OperationParameters* myParams, Progre
}
if (!outputRequested)
{
CaretLogWarning("no output requested from -cifti-separate, operation will do nothing");
CaretLogWarning("no output requested from -cifti-separate, command will do nothing");
}
}

Expand Down
69 changes: 63 additions & 6 deletions src/CommandLine/wb_shortcuts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ set -ue

global_cmd_line="$0 $*"
global_script_name="wb_shortcuts"
global_script_version="beta-0.2"

function version ()
{
echo "$global_script_name, version beta-0.2"
echo "$global_script_name, version $global_script_version"
}

function usage ()
Expand All @@ -50,7 +51,7 @@ function usage ()
}

#the main function is so that we can put the main code before other function definitions
#simply gets called as 'main "$@"' after all functions are defined
#it simply gets called as 'main "$@"' after all functions are defined
function main ()
{
#NOTE: if we have a lot of functions, check_functions could cause a short startup delay, could make a debug setting to control it
Expand Down Expand Up @@ -157,23 +158,37 @@ function cifti_concatenate ()
then
echo "`switch_to_descrip $function_switch`"
echo " $global_script_name $function_switch"
echo " [-map <map-number-or-name>] - use only the specified map from each input"
echo " file"
echo " <output-cifti>"
echo " <input-cifti-1>"
echo " ..."
echo
#wrap guide for 80 columns |
echo " Additional input files may be specified after the mandatory input file."
echo " The -map option takes either a 1-based index or a map name, and causes"
echo " the operation to use only one map from each input file."
echo
exit 0
fi
local -a maparg
if [[ "$1" == "-map" ]]
then
if (($# < 2))
then
error "-map option requires an argument"
fi
maparg=("-column" "$2")
shift 2
fi
if (($# < 2))
then
error "function requires 2 or more arguments"
fi
local -a merge_arg_array
for ((i = 2; i <= $#; ++i))
do
merge_arg_array+=("-cifti" "${!i}")
merge_arg_array+=("-cifti" "${!i}" "${maparg[@]}")
done
wb_command -cifti-merge "$1" "${merge_arg_array[@]}"
}
Expand Down Expand Up @@ -362,23 +377,37 @@ function label_concatenate ()
then
echo "`switch_to_descrip $function_switch`"
echo " $global_script_name $function_switch"
echo " [-map <map-number-or-name>] - use only the specified map from each input"
echo " file"
echo " <output-label>"
echo " <input-label-1>"
echo " ..."
echo
#wrap guide for 80 columns |
echo " Additional input files may be specified after the mandatory input file."
echo " The -map option takes either a 1-based index or a map name, and causes"
echo " the operation to use only one map from each input file."
echo
exit 0
fi
local -a maparg
if [[ "$1" == "-map" ]]
then
if (($# < 2))
then
error "-map option requires an argument"
fi
maparg=("-column" "$2")
shift 2
fi
if (($# < 2))
then
error "function requires 2 or more arguments"
fi
local -a merge_arg_array
for ((i = 2; i <= $#; ++i))
do
merge_arg_array+=("-label" "${!i}")
merge_arg_array+=("-label" "${!i}" "${maparg[@]}")
done
wb_command -label-merge "$1" "${merge_arg_array[@]}"
}
Expand All @@ -392,23 +421,37 @@ function metric_concatenate ()
then
echo "`switch_to_descrip $function_switch`"
echo " $global_script_name $function_switch"
echo " [-map <map-number-or-name>] - use only the specified map from each input"
echo " file"
echo " <output-metric>"
echo " <input-metric-1>"
echo " ..."
echo
#wrap guide for 80 columns |
echo " Additional input files may be specified after the mandatory input file."
echo " The -map option takes either a 1-based index or a map name, and causes"
echo " the operation to use only one map from each input file."
echo
exit 0
fi
local -a maparg
if [[ "$1" == "-map" ]]
then
if (($# < 2))
then
error "-map option requires an argument"
fi
maparg=("-column" "$2")
shift 2
fi
if (($# < 2))
then
error "function requires 2 or more arguments"
fi
local -a merge_arg_array
for ((i = 2; i <= $#; ++i))
do
merge_arg_array+=("-metric" "${!i}")
merge_arg_array+=("-metric" "${!i}" "${maparg[@]}")
done
wb_command -metric-merge "$1" "${merge_arg_array[@]}"
}
Expand Down Expand Up @@ -452,23 +495,37 @@ function volume_concatenate ()
then
echo "`switch_to_descrip $function_switch`"
echo " $global_script_name $function_switch"
echo " [-map <map-number-or-name>] - use only the specified map from each input"
echo " file"
echo " <output-volume>"
echo " <input-volume-1>"
echo " ..."
echo
#wrap guide for 80 columns |
echo " Additional input files may be specified after the mandatory input file."
echo " The -map option takes either a 1-based index or a map name, and causes"
echo " the operation to use only one map from each input file."
echo
exit 0
fi
local -a maparg
if [[ "$1" == "-map" ]]
then
if (($# < 2))
then
error "-map option requires an argument"
fi
maparg=("-subvolume" "$2")
shift 2
fi
if (($# < 2))
then
error "function requires 2 or more arguments"
fi
local -a merge_arg_array
for ((i = 2; i <= $#; ++i))
do
merge_arg_array+=("-volume" "${!i}")
merge_arg_array+=("-volume" "${!i}" "${maparg[@]}")
done
wb_command -volume-merge "$1" "${merge_arg_array[@]}"
}
Expand Down

0 comments on commit c170db0

Please sign in to comment.