From 3cee3eca8997da3f3f27a15e8800b0f51714cd11 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sun, 21 Mar 2021 18:14:41 +0100 Subject: [PATCH] misc: update names for D-Bus service file and zsh autocompletion: - using `li` as main shortcut for `libervia-cli` instead of `jp` - fix outdated Python version in `_li` zsh completion shell - following global name change, D-Bus service file is no `org.libervia.Libervia.service` and it launches `libervia-backend` --- misc/README | 8 ++++---- misc/{_jp => _li} | 14 +++++++------- ...i.SAT.service => org.libervia.Libervia.service} | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) rename misc/{_jp => _li} (95%) rename misc/{org.salutatoi.SAT.service => org.libervia.Libervia.service} (66%) diff --git a/misc/README b/misc/README index 57f2c84f..fa44eafc 100644 --- a/misc/README +++ b/misc/README @@ -1,15 +1,15 @@ -This directory contains files related to SàT but not directly used by it. +This directory contains files related to Libervia but not directly used by it. -* file _jp: +* file _li: This is the completion file for zsh. To use it, you need to have it in a path accessible in your fpath variable, and to have completion activated. This can be done by the following commands in your .zshrc: ### .zshrc completion ### -fpath=(/path/to/directory/with/_jp/ $fpath) +fpath=(/path/to/directory/with/_li/ $fpath) autoload -U compinit compinit ### end of .zshrc completion ### - Then, you should be able to complete a jp command line by pressing [TAB]. + Then, you should be able to complete a li command line by pressing [TAB]. * org.libervia.Libervia.service: This file is used by D-Bus to know how to launch the backend, you have to put in in D-Bus services dir (usually /usr/share/dbus-1/services) diff --git a/misc/_jp b/misc/_li similarity index 95% rename from misc/_jp rename to misc/_li index 64f81a58..451d36fc 100644 --- a/misc/_jp +++ b/misc/_li @@ -1,5 +1,5 @@ -#compdef jp jp_dev -# jp: a SAT command line tool +#compdef li libervia-cli li_dev jp jp_dev +# Libervia CLI: Command Line Interface for Libervia # Copyright (C) 2009-2016 Jérôme Poisson (goffi@goffi.org) # This program is free software: you can redistribute it and/or modify @@ -20,19 +20,19 @@ # - filtering imposibles arguments # - arguments (jids, files) -PYTHON='python2' +PYTHON='python3' local optionals subcommands arguments local context state state_descr line typeset -A val_args -_jp() { +_li() { eval `/usr/bin/env $PYTHON 2> /dev/null <<- PYTHONEND import re from subprocess import check_output # import sys - # words_raw="jp_dev " + ' '.join(sys.argv[1:]) # for debugging in a script + # words_raw="li_dev " + ' '.join(sys.argv[1:]) # for debugging in a script words_raw="$words" # $words is the command line currently completed words_all = words_raw.split() @@ -104,7 +104,7 @@ _jp() { current_args = [] while True: - # parse jp's help recursively until words_no_opt doesn't correspond anymore to a subcommand + # parse li's help recursively until words_no_opt doesn't correspond anymore to a subcommand try: current_args.append(words_no_opt.pop(0)) jp_help = check_output(current_args + ['--help']) @@ -138,4 +138,4 @@ _jp() { } -_jp "$@" +_li "$@" diff --git a/misc/org.salutatoi.SAT.service b/misc/org.libervia.Libervia.service similarity index 66% rename from misc/org.salutatoi.SAT.service rename to misc/org.libervia.Libervia.service index 1a2a46e1..b64a7317 100644 --- a/misc/org.salutatoi.SAT.service +++ b/misc/org.libervia.Libervia.service @@ -1,3 +1,3 @@ [D-BUS Service] Name=org.libervia.Libervia -Exec=sat +Exec=libervia-backend