mirror of https://github.com/aristocratos/bpytop
Changed to using argparse
parent
a99a57c733
commit
f19d883532
15
bpytop.py
15
bpytop.py
|
@ -17,9 +17,8 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import os, sys, threading, signal, re, subprocess, logging, logging.handlers
|
||||
import os, sys, threading, signal, re, subprocess, logging, logging.handlers, argparse
|
||||
import urllib.request
|
||||
import argparse
|
||||
from time import time, sleep, strftime, localtime
|
||||
from datetime import timedelta
|
||||
from _thread import interrupt_main
|
||||
|
@ -65,7 +64,7 @@ args.add_argument("-f" , "--full" ,action="store_true" ,help ="Start in full
|
|||
args.add_argument("-p" , "--proc" ,action="store_true" ,help ="Start in minimal mode without memory and net boxes")
|
||||
args.add_argument("-s" , "--stat" ,action="store_true" ,help ="Start in minimal mode without process box")
|
||||
args.add_argument("-v" , "--version" ,action="store_true" ,help ="Show version info and exit")
|
||||
args.add_argument("-D" , "--debug" ,action="store_true" ,help ="Start with loglevel set to DEBUG overriding value set in config")
|
||||
args.add_argument("--debug" ,action="store_true" ,help ="Start with loglevel set to DEBUG overriding value set in config")
|
||||
stdargs = args.parse_args()
|
||||
|
||||
if stdargs.version:
|
||||
|
@ -82,6 +81,11 @@ elif stdargs.proc:
|
|||
elif stdargs.stat:
|
||||
ARG_MODE = "stat"
|
||||
|
||||
if stdargs.debug:
|
||||
DEBUG = True
|
||||
else:
|
||||
DEBUG = False
|
||||
|
||||
#? Variables ------------------------------------------------------------------------------------->
|
||||
|
||||
BANNER_SRC: List[Tuple[str, str, str]] = [
|
||||
|
@ -214,11 +218,6 @@ THREADS: int = psutil.cpu_count(logical=True) or 1
|
|||
|
||||
THREAD_ERROR: int = 0
|
||||
|
||||
if stdargs.debug :
|
||||
DEBUG = True
|
||||
else:
|
||||
DEBUG = False
|
||||
|
||||
DEFAULT_THEME: Dict[str, str] = {
|
||||
"main_bg" : "",
|
||||
"main_fg" : "#cc",
|
||||
|
|
Loading…
Reference in New Issue