From 6ac9c825932eade64ac8707babec43079a129a14 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 8 Aug 2025 23:30:14 +0100 Subject: Make config argument optional --- CHANGELOG.md | 2 ++ klippy/klippy.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcee6cb0..163fc3cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ Most changes are breaking. option can be used to change the location. * The makefiles in `klippy/chelper` and `lib/hub-ctrl` are now used to build he respective `c_helper.so` and `hub-ctrl`. +* The config positional argument is now optional and defaults to + `/etc/klipper.cfg` ### Removed diff --git a/klippy/klippy.py b/klippy/klippy.py index 83a962fa..0cdb408f 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -340,10 +340,10 @@ def main(): options, args = opts.parse_args() if options.import_test: import_test() - if len(args) != 1: + if len(args) > 1: opts.error("Incorrect number of arguments") start_args = { - "config_file": args[0], + "config_file": args[0] if len(args) >= 1 else "/etc/klipper.cfg", "apiserver": options.apiserver, "start_reason": "startup", } -- cgit v1.2.3-70-g09d2