@@ -17,6 +17,7 @@ def __init__(self, *args, **kwargs):
1717 InkstitchExtension .__init__ (self , * args , ** kwargs )
1818 self .arg_parser .add_argument ("--tab" )
1919
20+ self .arg_parser .add_argument ("-c" , "--command" , type = str , default = "trim" , dest = "command" )
2021 self .arg_parser .add_argument ("-i" , "--minimum-jump-length" , type = float , default = 3.0 , dest = "min_jump" )
2122 self .arg_parser .add_argument ("-a" , "--maximum-jump-length" , type = float , default = 0 , dest = "max_jump" )
2223 self .arg_parser .add_argument ("-t" , "--use-command-symbols" , type = Boolean , default = False , dest = "use_command_symbols" )
@@ -59,14 +60,20 @@ def effect(self):
5960 self ._add_trim (last )
6061
6162 def _add_trim (self , element ):
63+ command = "trim"
64+ param = "trim_after"
65+ if self .options .command == "stop" :
66+ command = "stop"
67+ param = "stop_after"
68+
6269 # skip if the element already has a trim command in one way or the other
63- if element .has_command ("trim" ) or element .trim_after :
70+ if element .has_command (command ) or element .trim_after :
6471 return
6572
6673 if self .options .use_command_symbols :
67- add_commands (element , ["trim" ])
74+ add_commands (element , [command ])
6875 else :
69- element .node .set ('inkstitch:trim_after ' , True )
76+ element .node .set (f 'inkstitch:{ param } ' , True )
7077
7178 def _set_selection (self ):
7279 if not self .svg .selection :
0 commit comments