Skip to content

YMC-GitHub/sh-lib-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sh lib lang

desc

some function for handle lang for ymc shell lib

deps

test

  • sh-lib-path-resolve
  • sh-lib-test
  • sh-lib-time-cost
  • sh-lib-project-dir-map

prod

  • xxx

apis

  • lang_type_set
  • lang_type_get
  • lang_step_set
  • lang_step_now
  • lang_step_get
  • lang_sample
cat src/index.sh |  grep "function " | sed "s/function */- [x] /g"  | sed "s/(.*) *{//g"

feats

  • set operation step
  • get current step
  • support multi language

usage

how to use for poduction?

# get the code

# run the index file
# ./src/index.sh

# or import to your sh file
# source /path/to/the/index file

# simple usage
desc=$(cat <<EOF
#1.1 创建主机地址文件
#1.2 测试主机是否在线
EOF
)
lang_step_set "$desc" "zh" # or  lang_step_set "$desc" # default lang is zh
desc=$(cat <<EOF
#1.1 create host ip file
#1.2 ping to check if host is online
EOF
)
lang_step_set "$desc" "en"

lang_step_now "1" # =>#1.1 创建主机地址文件
lang_step_now "2" # =>#1.2 测试主机是否在线

lang_type_set "en"
lang_step_now "1" # => #1.1 create host ip file
lang_step_now "2" # => #1.2 ping to check if host is online

lang_type_set "zh"
lang_step_now "1" # =>#1.1 创建主机地址文件
lang_step_now "2" # =>#1.2 测试主机是否在线
lang_step_now "1.2" "" "step_mode" # =>#1.2 测试主机是否在线

how to use for developer?

# get the code

# run test
./test/index.sh
#2 get some fail test
./test/index.sh | grep "it is false"

author

yemiancheng ymc.github@gmail.com

license

MIT

About

some function for handle lang for ymc shell lib

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages