Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Remove popt #1659

Closed
wzdev-ci opened this issue Mar 3, 2010 · 19 comments
Closed

Remove popt #1659

wzdev-ci opened this issue Mar 3, 2010 · 19 comments

Comments

@wzdev-ci
Copy link
Contributor

wzdev-ci commented Mar 3, 2010

keyword_popt_arguments resolution_fixed type_patch (an actual patch, not a request for one) | by Per


The popt library is a unnecessary dependency. This patch removes it in favour of a very small and very quickly hacked together arguments parser that acts as a drop in replacement for our use of popt.


Issue migrated from trac:1659 at 2022-04-15 21:11:33 -0700

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 3, 2010

Per uploaded file popt-b-gone.diff (5.6 KiB)

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 3, 2010

Zarel commented


I am in support of this action.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 3, 2010

i-NoD commented


The idea is great, but I can't figure how to pass --mod="C:\Program files\WZ2100" because this results in two tokens...
Plus if there are no short form then argument is compared with "-", which could possibly lead to unwanted results.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 4, 2010

Per uploaded file popt-b-gone2.diff (6.2 KiB)

Thanks for the response. Both issues fixed in new patch.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 4, 2010

i-NoD commented


Function poptGetNextOpt() was fixed a bit (internal buffer issue and missing spaces, return actual enums instead of count ;) ) so it would parse smth like:

Warzone2100.exe --cheat --debug=all --mod=TCMask --configdir="c:\Users\123\Documents\WZ 2100 Trnk"

Btw, if its fine for Unix, will it work for Mac too?

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 4, 2010

Per commented


Nice fixups.

It should work fine on Mac. I see I forgot to remove a debug printf in there, and should probably remove the usage option before committing.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 5, 2010

i-NoD uploaded file popt.patch (5.0 KiB)

We should remove final qoutes from one-word params too.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 6, 2010

i-NoD commented


Per, could you please commit this feature? I'm keeping 10 shortcuts (new and old style) around and like to purge some :-/

As a note: i've made a non-critical mistake in the last patch and there should be

 if (ctx->table[i].argument && pparam)

check like in your original code.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 6, 2010

Buginator commented


Nice.

die popt die! :D

It will also kill off
libiconv-2.dll
popt1.dll
libintl-2.dll

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 6, 2010

i-NoD commented


Somehow I knew you would say it! :)

I think libiconv-2.dll and libintl-2.dll are still required for internalization, althought it's not strictly necessary for MSVC builds.

At least with popt death it will be possible to compile both into static libs.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2010

Per changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2010

Per set resolution to fixed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2010

Per commented


(In [10186]) Remove our dependency on popt by writing a custom popt-like parser. Patch by me and i-NoD. Closes #1659

@wzdev-ci wzdev-ci closed this as completed Mar 7, 2010
@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Mar 7, 2010

Git SVN Gateway <gateway@...> commented


(In Warzone2100/warzone2100@240bb91) Remove our dependency on popt by writing a custom popt-like parser. Patch by me and i-NoD. Closes #1659

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10186 4a71c877-e1ca-e34f-864e-861f7616d084

@wzdev-ci
Copy link
Contributor Author

Git SVN Gateway <gateway@...> commented


In Warzone2100/warzone2100@240bb91:

#CommitTicketReference repository="" revision="240bb9189125a5560535956d253c755ec0890d04"
Remove our dependency on popt by writing a custom popt-like parser. Patch by me and i-NoD. Closes #1659


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10186 4a71c877-e1ca-e34f-864e-861f7616d084

@wzdev-ci
Copy link
Contributor Author

buginator <buginator@...> commented


(In Warzone2100/warzone2100@2aca760) Remove our dependency on popt by writing a custom popt-like parser. Patch by me and i-NoD. Closes #1659

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10186 4a71c877-e1ca-e34f-864e-861f7616d084
(cherry picked from commit 240bb9189125a5560535956d253c755ec0890d04)

Conflicts:

configure.ac
src/Makefile.am

@wzdev-ci
Copy link
Contributor Author

buginator <buginator@...> commented


In Warzone2100/warzone2100@2aca760:

#CommitTicketReference repository="" revision="2aca760ab52865660c3c30bdb84eab4d2850e6ae"
Remove our dependency on popt by writing a custom popt-like parser. Patch by me and i-NoD. Closes #1659


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10186 4a71c877-e1ca-e34f-864e-861f7616d084
(cherry picked from commit 240bb9189125a5560535956d253c755ec0890d04)

Conflicts:

	configure.ac
	src/Makefile.am

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jan 3, 2012

cybersphinx changed milestone from 3.0 to unspecified

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jan 3, 2012

cybersphinx commented


Milestone 3.0 deleted

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant