Skip to content

Commit

Permalink
release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zlj-zz committed Jul 21, 2021
1 parent 3f6de41 commit e6fc866
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"editor.detectIndentation": true,
"editor.tabSize": 4,
"cSpell.words": [
"CWORD",
Expand Down
35 changes: 25 additions & 10 deletions pygittools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
# SOFTWARE.


__project__ = "git-tools"
__license__ = "MIT"
__version__ = "1.0.0-beta"
__version__ = "1.0.0"
__author__ = "Zachary Zhang"
__email__ = "zlj19971222@outlook.com"
__git_url__ = "https://github.com/zlj-zz/pygittools.git"
Expand Down Expand Up @@ -1263,18 +1264,18 @@ def echo_types():

def echo_description():
"""Print the description information"""
# from . import __version__

has_git = False
try:
_, git_version = run_cmd_with_resp("git --version")
if git_version:
has_git = True
except Exception:
Log.warning("Happen error when run command with get Git version")
Log.warning("Can not found Git in environment.")
git_version = ""

echo("[fungit] version: %s" % __version__, style=Fx.b)
echo("[%s] version: %s" % (__project__, __version__), style=Fx.b)
echo("path: %s" % __name__)
echo(git_version)
echo("Description:", style=Fx.b)
echo(
Expand All @@ -1295,6 +1296,10 @@ def echo_description():
warn("Don't found Git, maybe need install.")


def echo_version():
echo('version: %s' % __version__)


def command_g(custom_commands=None):
setup_logging(debug=False, log_file=TOOLS_HOME + "/log/gittools.log")

Expand All @@ -1308,32 +1313,38 @@ def command_g(custom_commands=None):
description="If you want to use some original git commands, please use -- to indicate.",
)
args.add_argument(
"-c", "--complete", action="store_true", help="Add shell prompt script and exit"
"-c",
"--complete",
action="store_true",
help="Add shell prompt script and exit.",
)
args.add_argument(
"-s",
"--show-commands",
action="store_true",
help="List all available fame and wealth and exit",
help="List all available fame and wealth and exit.",
)
args.add_argument(
"-S",
"--show-command",
type=str,
metavar="TYPE",
dest="command_type",
help="According to given type list available fame and wealth and exit",
help="According to given type list available fame and wealth and exit.",
)
args.add_argument(
"-t",
"--types",
action="store_true",
help="List all command type and exit",
help="List all command type and exit.",
)
args.add_argument(
"command", nargs="?", default="|", type=str, help="Short git command"
"-v", "--version", action="store_true", help="Show version and exit."
)
args.add_argument("args", nargs="*", type=str, help="Command parameter list")
args.add_argument(
"command", nargs="?", default="|", type=str, help="Short git command."
)
args.add_argument("args", nargs="*", type=str, help="Command parameter list.")
stdargs = args.parse_args()

if custom_commands is not None:
Expand All @@ -1356,6 +1367,10 @@ def command_g(custom_commands=None):
echo_types()
raise SystemExit(0)

if stdargs.version:
echo_version()
raise SystemExit(0)

if stdargs.command:
if stdargs.command == "|":
echo_description()
Expand Down

0 comments on commit e6fc866

Please sign in to comment.