aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tomasz@kramkow.ski>2025-08-08 23:30:14 +0100
committerTomasz Kramkowski <tomasz@kramkow.ski>2025-08-15 21:46:37 +0100
commit6ac9c825932eade64ac8707babec43079a129a14 (patch)
tree64f537e87b6cd9ad29bf80839c3fcbbb70d6cb40
parent3d8122a1fe91890f1a1c453416deada1924039b2 (diff)
downloadkutter-6ac9c825932eade64ac8707babec43079a129a14.tar.gz
kutter-6ac9c825932eade64ac8707babec43079a129a14.tar.xz
kutter-6ac9c825932eade64ac8707babec43079a129a14.zip
Make config argument optional
-rw-r--r--CHANGELOG.md2
-rw-r--r--klippy/klippy.py4
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",
}