Files
rk35xx-android14/external/shflags/examples/hello_world.sh
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

21 lines
526 B
Bash
Executable File

#!/bin/sh
#
# This is the proverbial 'Hello, world!' script to demonstrate the most basic
# functionality of shFlags.
#
# This script demonstrates accepts a single command-line flag of '-n' (or
# '--name'). If a name is given, it is output, otherwise the default of 'world'
# is output.
# Source shflags.
. ../shflags
# Define a 'name' command-line string flag.
DEFINE_string 'name' 'world' 'name to say hello to' 'n'
# Parse the command-line.
FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}"
echo "Hello, ${FLAGS_name}!"