Add QubesArgumentParser.print_error()

This commit is contained in:
Bahtiar `kalkin-` Gadimov 2016-05-07 21:12:08 +02:00 committed by Wojtek Porczyk
parent 454e1835fe
commit a65b0edcd4

View File

@ -25,10 +25,13 @@
'''Qubes' command line tools '''Qubes' command line tools
''' '''
from __future__ import print_function
import argparse import argparse
import importlib import importlib
import logging import logging
import os import os
import sys
import textwrap import textwrap
import qubes.log import qubes.log
@ -282,6 +285,11 @@ class QubesArgumentParser(argparse.ArgumentParser):
elif verbose >= 1: elif verbose >= 1:
qubes.log.enable() qubes.log.enable()
# pylint: disable=no-self-use
def print_error(self, *args, **kwargs):
''' Print to ``sys.stderr``'''
print(*args, file=sys.stderr, **kwargs)
def get_parser_for_command(command): def get_parser_for_command(command):
'''Get parser for given qvm-tool. '''Get parser for given qvm-tool.