thtauhid / terminal-portfolio

A portfolio site that looks and feels like a terminal. Built with React + Tailwind.
https://my-terminal-portfolio.vercel.app/
MIT License
25 stars 22 forks source link

updating so that only first word is taken as command #48

Closed Paulie-Aditya closed 9 months ago

Paulie-Aditya commented 9 months ago

Example writing $contact works but writing $contact 999 would not work since the entire input is being considered.

If we consider the command to be only the first word by using command = command.split()[0] and then running trim and tolowercase, we solve this problem

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
terminal-portfolio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 2, 2023 7:57am
Paulie-Aditya commented 9 months ago

ok this recent one works basically only one line of code, but it helps out in handling a few more cases

pls do consider this pr for hacktober

thtauhid commented 9 months ago

Hi @Paulie-Aditya Thanks for your interest.

If we were to implement this we might not get the benefit from #3.

When #3 is implemented the command will look something like this

setname Jake

What are your thoughts?

Regards THT

Paulie-Aditya commented 9 months ago

we can just keep those as edge cases, say the command is setname, then we will also consider the first argument basically a simple if else can be put in case to resolve that, not a big issue

thtauhid commented 9 months ago

Makes sense.

Let's do one thing. I'll first merge #3 and then merge this one to avoid any code conflict. This also means, you might need to add few more lines if needed. Does that work for you?

This PR will be considered under hacktoberfest.

Thanks

Paulie-Aditya commented 9 months ago

yep, works for me 👍

Paulie-Aditya commented 9 months ago

just do let me know what all commands have to take in additional input (after finishing up #3), I'll fix it accordingly

thtauhid commented 9 months ago

Cool. I'll update you when #3 is merged.

thtauhid commented 9 months ago

3 is merged. You can work on this now @Paulie-Aditya

Paulie-Aditya commented 9 months ago

@thtauhid done, Please do check the same and merge it upon success.

thtauhid commented 9 months ago

Hi @Paulie-Aditya If I enter setname tauhid, the space is getting removed between setname and tauhid and it's showing command not found. Can you check this once?

image

thtauhid commented 9 months ago

@Paulie-Aditya you need to merge the main branch to your feature branch.

Paulie-Aditya commented 9 months ago

gimme some time, I'll mention you once this is fixed

Paulie-Aditya commented 9 months ago

nvm my code was fine, only had problems in taking previous merged stuff into account

Paulie-Aditya commented 9 months ago

cool @thtauhid , works now. Please perform the necessary checks and approve if found satisfactory.

thtauhid commented 9 months ago

Nice work @Paulie-Aditya

Looking forward to seeing more contributions from you in open source.


Join our Discord server to discuss ideas, ask questions, and collaborate with others.