Script Refactoring

This commit is contained in:
skiffer-git 2024-04-02 15:16:02 +08:00
parent 1b45539b77
commit d9adcc50bf
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package main
import (
"flag"
"fmt"
"time"
)
func main() {
// Define flags
index := flag.Int("i", 0, "Index number")
config := flag.String("c", "", "Configuration path")
// Parse the flags
flag.Parse()
// Print the values of the flags
fmt.Printf("args: -i %d -c %s\n", *index, *config)
time.Sleep(500 * time.Second)
}

View File

@ -20,3 +20,5 @@ if [ $ret_val -ne 0 ]; then
echo "no stop..."
exit 1
fi
echo "all stop"