import argparse
from datetime import date

def get_current_date():
    today = date.today()
    year = str(today.year)
    month = str(today.month)
    day = str(today.day)
    date_string = year + '-' + month + '-' + day
    return date_string

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('title', help='Post title')
    args = parser.parse_args()
    post_title = args.title
    date_prefix = get_current_date()
    print(" Post Title: ", post_title)
    print(" Date Prefix: ", date_prefix)

if __name__ == '__main__':
    main()

@@ -36,16 +36,190 @@
 t date%0A%0A
+def get_filename(post_title, date_prefix):%0A    title_formatted = post_title.replace(' ', '-')%0A    filename = date_prefix + '-' + title_formatted + '.md'%0A    return filename%0A%0A
 def get_
@@ -574,16 +574,24 @@
 gs.title
+.strip()
 %0A    dat
@@ -620,16 +620,92 @@
 _date()%0A
+    filename = get_filename(post_title=post_title, date_prefix=date_prefix)%0A
     prin
@@ -775,16 +775,51 @@
 _prefix)
+%0A    print(%22 Filename: %22, filename)
 %0A%0Aif __n

Generating proper filename. Stripping the original title from the command-line