From 02420800cbf0ee6d170a579270f79c7f98c6ab95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Tue, 15 Nov 2016 13:07:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D0=BE=D0=B9=20=D1=81?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Все опции вида -rqw преобрауются в -r -q -w перед обработки, чтобы исключить разную обработки для -soff ("-s -o -f -f" или "-s" и аргумент "off") --- pym/console/application/cl_client.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pym/console/application/cl_client.py b/pym/console/application/cl_client.py index 92fa414..ff29c8c 100644 --- a/pym/console/application/cl_client.py +++ b/pym/console/application/cl_client.py @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. from calculate.core.server.local_call import Display, Methods, has_force_arg +from calculate.lib.utils.tools import unpack_single_opts from sudsds import WebFault from sudsds.transport import TransportError @@ -270,6 +271,7 @@ def https_server(client, args, unknown_args, url, clVarsCore, wait_thread): elif args.method and args.help: # вычислить наличие флага --force + method_parser = None try: dispatch_usenew = has_force_arg(unknown_args) while True: @@ -286,7 +288,6 @@ def https_server(client, args, unknown_args, url, clVarsCore, wait_thread): _unknown_args) if dispatch_usenew == _args.no_questions: - method_parser.print_help() break else: client.service.clear_method_cache(client.sid, args.method) @@ -295,6 +296,8 @@ def https_server(client, args, unknown_args, url, clVarsCore, wait_thread): wait_thread.stop() sys.stdout.write("\b") sys.stdout.flush() + client.service.clear_method_cache(client.sid, args.method) + method_parser.print_help() else: method_result = call_method(client, args, unknown_args, wait_thread) mr = get_message_receiver(client) @@ -339,7 +342,8 @@ def https_server(client, args, unknown_args, url, clVarsCore, wait_thread): def main(wait_thread): parser = parse() - args, unknown_args = parser.parse_known_args() + args, unknown_args = parser.parse_known_args( + list(unpack_single_opts(sys.argv[1:]))) wait_thread.start() sym_link = os.path.basename(sys.argv[0]) @@ -375,7 +379,8 @@ def main(wait_thread): wait_thread.stop() sys.stdout.write('\r') sys.stdout.flush() - args = parser.parse_args() + args = parser.parse_args( + list(unpack_single_opts(sys.argv[1:]))) logging.basicConfig(level=logging.FATAL) logging.getLogger('sudsds.client').setLevel(logging.FATAL)