Skip to content

Commit

Permalink
Switched the 'ls -L' and the logging '-l' flags
Browse files Browse the repository at this point in the history
  • Loading branch information
your name committed Sep 24, 2024
1 parent dbf5438 commit b1eb92e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
8 changes: 1 addition & 7 deletions cmd/object_ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,12 @@ var (
func init() {
flagSet := lsCmd.Flags()
flagSet.StringP("token", "t", "", "Token file to use for transfer")
flagSet.BoolP("long", "L", false, "Include extended information - The '-L' for long output will be changed to '-l' in the 7.11.0 pelican release")
flagSet.BoolP("long", "l", false, "Include extended information")
flagSet.BoolP("collectionOnly", "C", false, "List collections only")
flagSet.BoolP("objectonly", "O", false, "List objects only")
flagSet.BoolP("json", "j", false, "Print results in JSON format")

objectCmd.AddCommand(lsCmd)

lsCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
if cmd.Flags().Changed("long") {
log.Warningln("The '-L' for long output will be changed to '-l' in the 7.11.0 pelican release")
}
}
}

func listMain(cmd *cobra.Command, args []string) error {
Expand Down
8 changes: 1 addition & 7 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func init() {
panic(err)
}

rootCmd.PersistentFlags().StringP("log", "l", "", "Specified log output file - The '-l' for logging will be changed to '-L' in the 7.11.0 pelican release")
rootCmd.PersistentFlags().StringP("log", "L", "", "Specified log output file")
if err := viper.BindPFlag("Logging.LogLocation", rootCmd.PersistentFlags().Lookup("log")); err != nil {
panic(err)
}
Expand All @@ -169,10 +169,4 @@ func init() {
if err := viper.BindPFlag("Server.WebPort", portFlag); err != nil {
panic(err)
}

rootCmd.PersistentPreRun = func(cmd *cobra.Command, args []string) {
if cmd.Flags().Changed("log") {
log.Warningln("The '-l' for logging will be changed to '-L' in the 7.11.0 pelican release")
}
}
}
4 changes: 2 additions & 2 deletions github_scripts/get_put_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ do
done

# Run pelican object put
./pelican object put ./get_put_tmp/input.txt pelican://$HOSTNAME:8444/test/input.txt -d -t get_put_tmp/test-token.jwt -l get_put_tmp/putOutput.txt
./pelican object put ./get_put_tmp/input.txt pelican://$HOSTNAME:8444/test/input.txt -d -t get_put_tmp/test-token.jwt -L get_put_tmp/putOutput.txt

# Check output of command
if grep -q "Dumping response: HTTP/1.1 200 OK" get_put_tmp/putOutput.txt; then
Expand All @@ -134,7 +134,7 @@ else
exit 1
fi

./pelican object get pelican://$HOSTNAME:8444/test/input.txt get_put_tmp/output.txt -d -t get_put_tmp/test-token.jwt -l get_put_tmp/getOutput.txt
./pelican object get pelican://$HOSTNAME:8444/test/input.txt get_put_tmp/output.txt -d -t get_put_tmp/test-token.jwt -L get_put_tmp/getOutput.txt

# Check output of command
if grep -q "HTTP Transfer was successful" get_put_tmp/getOutput.txt; then
Expand Down

0 comments on commit b1eb92e

Please sign in to comment.