14
14
use Symfony \Component \Console \Command \Command ;
15
15
use Symfony \Component \Console \Input \InputArgument ;
16
16
use Symfony \Component \Console \Input \InputInterface ;
17
+ use Symfony \Component \Console \Input \InputOption ;
17
18
use Symfony \Component \Console \Output \OutputInterface ;
18
19
use Symfony \Component \Workflow \Dumper \GraphvizDumper ;
19
20
use Symfony \Component \Workflow \Dumper \StateMachineGraphvizDumper ;
@@ -37,6 +38,7 @@ protected function configure()
37
38
->setDefinition (array (
38
39
new InputArgument ('name ' , InputArgument::REQUIRED , 'A workflow name ' ),
39
40
new InputArgument ('marking ' , InputArgument::IS_ARRAY , 'A marking (a list of places) ' ),
41
+ new InputOption ('label ' , 'l ' , InputArgument::OPTIONAL , 'Labels a graph ' ),
40
42
))
41
43
->setDescription ('Dump a workflow ' )
42
44
->setHelp (<<<'EOF'
@@ -73,6 +75,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
73
75
$ marking ->mark ($ place );
74
76
}
75
77
76
- $ output ->writeln ($ dumper ->dump ($ workflow ->getDefinition (), $ marking ));
78
+ $ options = array ();
79
+ $ label = $ input ->getOption ('label ' );
80
+ if (null !== $ label && '' !== trim ($ label )) {
81
+ $ options = array ('graph ' => array ('label ' => $ label ));
82
+ }
83
+ $ output ->writeln ($ dumper ->dump ($ workflow ->getDefinition (), $ marking , $ options ));
77
84
}
78
85
}
0 commit comments