mirror of
https://github.com/danieldemus/pyp2spec.git
synced 2026-07-29 05:34:22 +02:00
Create user facing pyp2spec generating both parts together
This commit is contained in:
+11
-10
@@ -115,7 +115,7 @@ def fill_in_template(config):
|
||||
return result
|
||||
|
||||
|
||||
def write_spec_file(config, output=None):
|
||||
def save_spec_file(config, output=None):
|
||||
"""Save the spec file in the current directory.
|
||||
Return the saved file name"""
|
||||
|
||||
@@ -131,19 +131,20 @@ def write_spec_file(config, output=None):
|
||||
return spec_file_name
|
||||
|
||||
|
||||
def create_spec_file(config_file, spec_output=None):
|
||||
"""Create and save the generate spec file."""
|
||||
config = ConfigFile(config_file)
|
||||
return save_spec_file(config, spec_output)
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.argument("config")
|
||||
@click.option(
|
||||
"--filename", "-f",
|
||||
required=True,
|
||||
help="Provide configuration file",
|
||||
)
|
||||
@click.option(
|
||||
"--output", "-o",
|
||||
"--spec-output", "-s",
|
||||
help="Provide custom output where spec file will be saved",
|
||||
)
|
||||
def main(filename, output):
|
||||
config = ConfigFile(filename)
|
||||
write_spec_file(config, output)
|
||||
def main(config, spec_output):
|
||||
create_spec_file(config, spec_output)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user