Skip to content
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

Switched the 'ls -L' and the logging '-l' flags #1598

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading