@@ -71,9 +71,30 @@ func main() {
7171 case "add-bib" :
7272 _ = addBibCmd .Parse (os .Args [2 :])
7373 if * addBibTitle == "" || * addBibAuthor == "" || * addBibType == "" || * addBibClass == 0 || * addBibYear == 0 {
74- fmt .Println ("Please provide required fields: -title, -author, -type, -class, -year" )
75- addBibCmd .PrintDefaults ()
76- os .Exit (1 )
74+ if * addBibTitle == "" {
75+ * addBibTitle = promptString ("Title" , true )
76+ }
77+ if * addBibAuthor == "" {
78+ * addBibAuthor = promptString ("Author" , true )
79+ }
80+ if * addBibPublisher == "" {
81+ * addBibPublisher = promptString ("Publisher" , false )
82+ }
83+ if * addBibType == "" {
84+ * addBibType = promptString ("Type" , true )
85+ }
86+ if * addBibClass == 0 {
87+ * addBibClass = promptInt ("Classification Code Number" , true )
88+ }
89+ if * addBibYear == 0 {
90+ * addBibYear = promptInt ("Published Year" , true )
91+ }
92+ if * addBibISBN == "" {
93+ * addBibISBN = promptString ("ISBN" , false )
94+ }
95+ if * addBibIndex == "" {
96+ * addBibIndex = promptString ("BibIndex" , false )
97+ }
7798 }
7899 // Construct date from year
79100 publishedDate := time .Date (* addBibYear , 1 , 1 , 0 , 0 , 0 , 0 , time .UTC )
@@ -88,9 +109,15 @@ func main() {
88109 case "add-review" :
89110 _ = addReviewCmd .Parse (os .Args [2 :])
90111 if * addReviewBibIndex == "" || * addReviewGoals == "" {
91- fmt .Println ("Please provide required fields: -bib-index, -goals" )
92- addReviewCmd .PrintDefaults ()
93- os .Exit (1 )
112+ if * addReviewBibIndex == "" {
113+ * addReviewBibIndex = promptString ("BibIndex" , true )
114+ }
115+ if * addReviewGoals == "" {
116+ * addReviewGoals = promptString ("Goals" , true )
117+ }
118+ if * addReviewSummary == "" {
119+ * addReviewSummary = promptString ("Summary" , false )
120+ }
94121 }
95122
96123 // Resolve BibIndex to ID efficiently
@@ -114,9 +141,16 @@ func main() {
114141 case "update-review" :
115142 _ = updateReviewCmd .Parse (os .Args [2 :])
116143 if * updateReviewID == "" {
117- fmt .Println ("Please provide required field: -review-id" )
118- updateReviewCmd .PrintDefaults ()
119- os .Exit (1 )
144+ * updateReviewID = promptString ("Review UUID" , true )
145+ }
146+ if * updateReviewGoals == "" && * updateReviewSummary == "" {
147+ // If neither is provided via flags, prompt for them
148+ if * updateReviewGoals == "" {
149+ * updateReviewGoals = promptString ("New goals" , false )
150+ }
151+ if * updateReviewSummary == "" {
152+ * updateReviewSummary = promptString ("New summary" , false )
153+ }
120154 }
121155
122156 // Parse UUID
@@ -136,10 +170,10 @@ func main() {
136170 summary = updateReviewSummary
137171 }
138172
139- // Validate at least one field is provided
173+ // Validate at least one field is provided (after prompting)
140174 if goals == nil && summary == nil {
141175 fmt .Println ("Please provide at least one field to update: -goals or -summary" )
142- updateReviewCmd . PrintDefaults ()
176+ // If interactive mode was used, they might have skipped both optional fields
143177 os .Exit (1 )
144178 }
145179
0 commit comments