We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b5840c commit 07b6627Copy full SHA for 07b6627
db_diff/cli.py
@@ -170,9 +170,14 @@ def cli(
170
171
# Set default output filename if needed
172
if output == "jsonfile":
173
+ timestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
174
if not output_file:
- timestamp = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
175
output_file = f"{timestamp}_diffs.json"
176
+ else:
177
+ # Append the user-specified filename to the timestamp
178
+ base_name = os.path.splitext(output_file)[0] # Remove extension if present
179
+ output_file = f"{timestamp}_diffs_{base_name}.json"
180
+
181
if output_path:
182
if not os.path.isdir(output_path):
183
raise click.ClickException(f"Output path '{output_path}' does not exist or is not a directory.")
0 commit comments