Skip to content

Commit

Permalink
show-shell added to allas_conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimmo Mattila committed Mar 24, 2024
1 parent 1cabe1e commit 1f3d4aa
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions allas_conf
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ Usage: source allas_conf [OPTIONS] [PROJECT]
--s3remove Remove S3 access key for an Allas project.
--show-powershell After configuration, show swift authentication related environment
variables in format that can be used to enable Rclone
--show-shell After configuration, show bash / zsh commands that set swift authentication
related environment variables. These commands can be used to enable Rclone
connection to Allas in bash or zsh shell.
--show-powershell After configuration, show PowerShell commands that set swift authentication
related environment variables. These commnads can be used to enable Rclone
connection to Allas in Windows PowerShell.
Expand Down Expand Up @@ -135,6 +139,7 @@ local ood=false
local project_list_method=curl
local sd_connect=false
local show_powershell=false
local show_shell=false

# Process command line arguments

Expand All @@ -156,6 +161,7 @@ while [[ $# -ge 1 ]]; do
'--lumi') mode="lumi"; shift;;
'--sd' ) sd_connect=true; keep_password=true; shift;;
'--show-powershell' ) show_powershell=true; shift;;
'--show-shell' ) show_shell=true; shift;;
'-p'|'--project' )
if [[ -z $2 ]]; then
if [[ ${2::1} != "-" ]];then
Expand Down Expand Up @@ -734,6 +740,22 @@ if [[ $show_powershell ]]; then
fi


# Show OS_ environment variables in bash/zsh format
if [[ $show_shell ]]; then
echo ""
echo "--------------------------------------------------------------"
echo "Allas autentication parameters in bash and zsh compatible format."
echo "If your machine has Rclone installed, and allas: endpoint has been"
echo "configured, you can use the commands below to activate "
echo "Allas connection in your machine."
echo ""
echo "--------------------------------------------------------------"
env | grep OS_ | awk -F "=" '{ if ( $2 != "") print "export "$1"=\""$2"\""}'
fi





}

Expand Down

0 comments on commit 1f3d4aa

Please sign in to comment.